Syntax Lookup

Enter some language construct you want to know more about.

and

This is the and keyword for mutually recursive definitions.

Use and to define multiple items in one mutually-recursive group.

Example 1: let rec ... and ...

ReScriptJS Output
let rec isEven = n => n == 0 || isOdd(n - 1)
and isOdd = n => n != 0 && isEven(n - 1)

Example 2: type rec ... and ...

ReScriptJS Output
type rec expr = Add(expr, term) | Term(term)
and term = Int(int)

References