Witchcraft v0.5.0 Witchcraft.Functor.Operator

Operator aliases for Witchcraft.Operator

Summary

Functions

Alias for lift. As we’ll see with Witchcraft.Applicative, this arrow points in the direction of data flow (just like |>), but we often prefer the function on the left side

Alias for lift and <~, but with data flowing to the right

Functions

func <~ args

Specs

(any -> any) <~ any :: any

Alias for lift. As we’ll see with Witchcraft.Applicative, this arrow points in the direction of data flow (just like |>), but we often prefer the function on the left side.

Examples

iex> times10 = fn x -> x * 10 end
...> times10 <~ [1,2,3]
[10, 20, 30]
args ~> func

Specs

any ~> (any -> any) :: any

Alias for lift and <~, but with data flowing to the right.

Examples

iex> [1,2,3] ~> &(&1 * 10)
[10, 20, 30]