Lambda Discipline

Examples

Curried functions

tests/golden/programs/curried_functions.lbd

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

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

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

Output

18
6
6

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