We all love the feeling of writing a nice pipeline, but using anonymous
functions and captures to deal with :ok tuples can get rather frustrating.
Instead, I'd like the ability to utilise `!>! to tell the Elixir to unwrap
the tuple for me, only on {:ok, val} - crashing on anything else.
Example:
1
|> twice # 2
|> ok_tuple # {:ok, 2}
!> twice # 4
defp twice(val), do:val*2
defp ok_tuple(val), do: {:ok,val}
I have already started an implementation and it seems pretty simple. The
only question now is: Is this a valuable addition to Elixir?
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/1c6103ec-bf2c-4366-984c-bdc5a931191b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.