Skip to content

Instantly share code, notes, and snippets.

@Villane
Villane / IfThenElse.ops
Last active December 16, 2015 17:59
Syntax sugar: if type () -> X (nullary function returning X) is expected and we have an expression of type X, convert the expression into a lambda: () -> expr This allows custom functions to implement control structures like if-then-else, where the branches are evaluated only if needed
operators IfThenElse
group ifthenelse = "If…Then…Else…"
ifthenelse -> arithmetic, relations, brackets