Combinators over {:ok, value} | {:error, reason}.
The tagged tuple is the ecosystem's result type, so nothing is wrapped: with
is the bind, and these name the few compositions a transition needs so it
can be a value. kleisli/1 composes a list of arrows into one; ensure/2
lifts a predicate into an arrow, for guards and properties that only test.
Summary
Functions
An arrow that passes its value through when pred holds and is {:error, reason} otherwise.
Composes arrows left to right into one arrow; the empty list is the identity.
Types
Functions
@spec ensure((a -> as_boolean(term())), term()) :: arrow(a, a) when a: term()
An arrow that passes its value through when pred holds and is {:error, reason} otherwise.
Composes arrows left to right into one arrow; the empty list is the identity.