Quick examples:

(\x::String -> x ++ x)
foldr(\a::Integer b::Integer -> a + b, 0, [1, 2, 3, 4])


\ parameters -> expression

All parameters must be given explicit types, just as in normal function declarations. However, you don’t need to explicitly provide the return type, only the parameter types.


Functions generated by a lambda expression have exactly the same semantics as a normal function. They can be applied, partially applied, passed as parameters, etc.

Any values in scope are implicitly captured and can be used, even if the resulting function is passed outside the scope of the captured values.

There is really no interaction or special behavior with nonterminals/flow analysis/etc. Decorated and undecorated nonterminals can be captured and used as parameters as expected.