Witchcraft v0.5.0 Witchcraft.Monad.Operator

Operator aliases for Witchcraft.Monad

Summary

Functions

Operator alias for bind, with arguments reversed

Operator alias for bind

Functions

fun <<< wrapped

Specs

(any, any -> any) <<< any :: any

Operator alias for bind, with arguments reversed

Examples

iex> use Witchcraft.Applicative
...> fn x -> [x * 10] end <<< [1,2,3]
[10, 20, 30]
bind_a <~> bind_b

Specs

(... -> any) <~> (... -> any) :: (... -> any)
wrapped >>> fun

Specs

any >>> (any, any -> any) :: any

Operator alias for bind

Examples

iex> use Witchcraft.Applicative
...> [1,2,3] >>> fn x -> [x * 10] end
[10, 20, 30]

iex> [1,2,3] >>> fn x ->
...>   [x+1] >>> fn y ->
...>     [y*x, y*10, x-1]
...>   end
...> end
[2,20,0,6,30,1,12,40,2]