1
|> twice # 2
|> ok_tuple # {:ok, 2}
!> twice # 4
defp twice(val), do:val*2
defp ok_tuple(val), do: {:ok,val}
--
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 elixir-lang-core+unsubscribe@googlegroups.com.
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.
Hi David,If you search the mailing list archives, you will see proposals to the pipe operator are very common. If we had accepted them all, it would have become a very complex beast.The pipe operator works because it is simple. So we plan to keep it that way.Thank you,
On Thu, Aug 17, 2017 at 1:01 PM, <david.and...@gmail.com> wrote:
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 elixir-lang-co...@googlegroups.com.