Witchcraft v1.0.0 Witchcraft.Semigroupoid.Proto protocol View Source

Protocol for the Elixir.Witchcraft.Semigroupoid type class

For this type class’s API, please refer to Elixir.Witchcraft.Semigroupoid

Link to this section Summary

Functions

Express how to apply arguments to the very end of a semigroupoid, or “run the morphism”. This should not be used to inject values part way though a composition chain

Take some value and return it again

Link to this section Types

Link to this section Functions

Express how to apply arguments to the very end of a semigroupoid, or “run the morphism”. This should not be used to inject values part way though a composition chain.

It is provided here to remain idiomatic with Elixir, and to make prop testing possible.

Examples

iex> Witchcraft.Semigroupoid.apply(&inspect/1, [42])
"42"

Take some value and return it again

Examples

iex> times_ten_plus_one = compose(fn x -> x + 1 end, fn y -> y * 10 end)
...> times_ten_plus_one.(5)
51