monex v0.1.16 MonEx.Arrows
Arrows module inroduces short syntax for MonEx.map/2 and MonEx.flat_map/2.
Link to this section Summary
Link to this section Functions
Link to this function
m ~> f
Alias for MonEx.map/2 to be used in infix position.
Example:
iex> f = fn (x) ->
...> x * 2
...> end
...> some(5) ~> f
some(10)
...> none() ~> f
none()
Link to this function
m ~>> f
Alias for MonEx.flat_map/2 to be used in infix position.
Example:
iex> f = fn (x) ->
...> ok(x * 2)
...> end
...> ok(5) ~>> f
ok(10)
...> error("Error") ~>> f
error("Error")