Packages

An exploratory look into functors, applicatives, and monads for Elixir.

Current section

Files

Jump to
control lib control monad maybe.ex
Raw

lib/control/monad/maybe.ex

defimpl Control.Monad, for: Data.Maybe do
def bind(%{nothing: true} = f, _), do: f
def bind(%{just: v}, fun) do
fun |> apply([v])
end
def left ~>> right do
left |> bind(right)
end
end