ZVON > References > Haskell reference
| Indexes | >> Syntax << | Prelude | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Name let expressions
Description a nested, lexically-scoped, mutually-recursive list of declarations (let is often called letrec in other languages). The scope of the declarations is the expression and the right hand side of the declarations.
Related:
Bibliography: Lexical Scoping and Nested Forms [ A Gentle Introduction to Haskell ]

Example 1
Program source: 

aaa = let y = 1+2
          z = 4+6
          in  y+z

Input: aaa

Output: 13

Example 2
Program source: 

aaa x y = let r = 3 
              s = 6
              in  r*x + s*y

Input: aaa 2 4

Output: 30

Example 3
Program source: 

aaa x y = let r = 3*x 
              s = 6*y
              in  r + s

Input: aaa 2 4

Output: 30