Lambda Discipline

Examples

Curried functions

tests/golden/programs/curried_functions.lbd

add3 : Number -> Number -> Number -> Number = \a. \b. \c. (add (add a b) c)

partialAdd : Number -> Number -> Number = (add3 10)
partialAdd2 : Number -> Number = (partialAdd 5)

(println (partialAdd2 3))
(println (add3 1 2 3))
(println ((add3 1) 2 3))

Output

18
6
6

Run it yourself from the repository root: lbd run tests/golden/programs/curried_functions.lbd