11.3.1.2 Haskell's latency calculation policy, 11.3.1.2haskell

Source: Internet
Author: User

11.3.1.2 Haskell's latency calculation policy, 11.3.1.2haskell

11.3.1.2 Haskell latency calculation Policy

 

In lazy evaluation strategy, the parameter value of the function is not calculated during function calling until it is used later. Let's go back to the previous example:

 

TestAndCalculate (Calculate (10 ));

 

Haskell jumps directly to the subject of the TestAndCalculate function. Haskell remembers that the name of the parameter value is num. If num is required later, Calculate (10) is run. Then, continue to run the command to obtain the result of TestCondition. If this function returns true, it indicates that the value of num is required, and Calculate (10) is executed. If TestCondition returns false, the Calculate function is not called at all.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.