View Source Arrows (bonfire v0.3.5-classic-beta.6)

A handful of (mostly) arrow macros with superpowers.

Link to this section 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.~>

Link to this section 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.~>