Realm v0.1.0 Realm.Semigroupoid.Algebra View Source
Link to this section Summary
Link to this section Functions
Link to this function
compose(left, right)
View Sourcecompose(Realm.Semigroupoid.t(), Realm.Semigroupoid.t()) :: Realm.Semigroupoid.t()
compose/2
, but with the arguments flipped (same direction as |>
).
Examples
iex> import Realm.Semigroupoid.Algebra
...> times_ten_plus_one = compose(fn y -> y * 10 end, fn x -> x + 1 end)
...> times_ten_plus_one.(5)
51
Link to this function
pipe(data, semigroupoid)
View Sourcepipe(any(), Realm.Semigroupoid.t()) :: any()
Pipe some data through a morphism.
Similar to apply/2
, but with a single argument, not needing to wrap
the argument in a list.
Examples
iex> import Realm.Semigroupoid.Algebra
...> pipe(42, &(&1 + 1))
43