Packages

This lib adds a "new" pipe operator that is similar to the Maybe type on other functional programming languages.

Current section

Files

Jump to
pipe_operators lib pipe_operators.ex
Raw

lib/pipe_operators.ex

defmodule PipeOperators.SkipOnErrorPipe do
defmacro previous_value ~> function do
quote do
unquote(previous_value)
|> case do
{:error, error} -> {:error, error}
result -> result |> unquote(function)
end
end
end
end