Witchcraft v0.3.0 Witchcraft.Monoid.Operator
Summary
Functions
Specs
any <|> any :: any
Infix variant of Monoid.append
Example
iex> import Witchcraft.Monoid
...> defimpl Witchcraft.Monoid, for: Integer do
...> def identity(_), do: 0
...> def append(a, b), do: a + b
...> end
iex> 1 |> append(4) |> append(2) |> append(10)
17
iex> 1 <|> 4 <|> 2 <|> 10
17
iex> import Witchcraft.Monoid
iex> 1 |> append(4) |> append(2) |> append(10)
17
iex> [42, 43] <|> [44] <|> [45, 46] <|> [47]
[42, 43, 44, 45, 46, 47]