Control structures
Case
A case expression has the following syntax:
case value
| pat1 := branch1
..
| patN := branchN
For example, one can evaluate the following expression in the REPL:
Stdlib.Prelude> case 2 | zero := 0 | suc x := x | _ := 19
1
Lazy builtins
The standard library provides several builtin functions which are treated specially and evaluated lazily. These builtins must always be fully applied.
if condition branch1 branch2
. First evaluatescondition
, if true evaluates and returnsbranch1
, otherwise evaluates and returnsbranch2
.a || b
. Lazy disjunction. First evaluatesa
, if true returns true, otherwise evaluates and returnsb
.a && b
. Lazy conjunction. First evaluatesa
, if false returns false, otherwise evaluates and returnsb
.a >> b
. Sequences two IO actions. Lazy in the second argument.