View Source Arrows (bonfire_umbrella v0.9.8-cooperation-beta.31)

A handful of (mostly) arrow macros with superpowers.

Summary

Functions

Like ||, except only defaults if the left is nil (i.e. false is valid)

Like ||, except with the logic applied by ~>

A more flexible drop-in replacement for the standard elixir pipe operator.

Like OK.~>

Functions

Like ||, except only defaults if the left is nil (i.e. false is valid)

Like ||, except with the logic applied by ~>

A more flexible drop-in replacement for the standard elixir pipe operator.

Special features are unlocked when using the ... (ellipsis) on the right hand side:

  • The right hand side need not be a function, it can be any expression containing the ellipsis.
  • The ellipsis will be replaced with the result of evaluating the hand side expression.
  • You may use the ellipsis multiple times and the left hand side will be calculated exactly once.

You can do crazy stuff with the ellipsis, but remember that people have to read it!

Like OK.~>