Mandrake v0.0.2 Mandrake.Function
Mandrake functional functions.
Summary
Functions
Function that return always the given value
Returns the composition of two functions
Returns an anonymous function that wrap the given
Function that do nothing
Call the given function with the given object
Functions
Function that return always the given value.
Examples
iex> printExample = Mandrake.Function.always("Example")
...> printExample.()
"Example"
Returns the composition of two functions.
Examples
iex> printHello = Mandrake.Function.compose(fn x -> "Hello " <> to_string(x) end, fn y -> y + 1 end)
...> printHello.(6)
"Hello 7"
Returns an anonymous function that wrap the given.
Examples
iex> mod = Mandrake.Function.lambda("Mandrake.Math.modulo", 2)
...> mod.(20, 5)
0