Realm v0.1.0 Realm.Semigroupoid.Algebra View Source

Link to this section Summary

Functions

compose/2, but with the arguments flipped (same direction as |>).

Pipe some data through a morphism. Similar to apply/2, but with a single argument, not needing to wrap the argument in a list.

Link to this section Functions

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 Source
pipe(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