I wrote something like that already, when there was no `with` : https://hex.pm/packages/monk
But I do not use it that much in the end. Le jeudi 17 août 2017 13:33:31 UTC+2, [email protected] a écrit : > > Yeah, I've read a few of them and found some user land libraries that seem > to implement something akin to this proposal. > > No problem. > Thanks > > On Thursday, 17 August 2017 13:03:25 UTC+2, José Valim wrote: >> >> 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, >> >> >> >> *José Valim* >> www.plataformatec.com.br >> Skype: jv.ptec >> Founder and Director of R&D >> >> On Thu, Aug 17, 2017 at 1:01 PM, <[email protected]> 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 [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 >>> >>> <https://groups.google.com/d/msgid/elixir-lang-core/1c6103ec-bf2c-4366-984c-bdc5a931191b%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- 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/901f7803-0ff2-4877-a9e4-d3910a4b563b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
