[erlang-questions] Pipe Operator in Erlang?

Pierre Fenoll pierrefenoll@REDACTED
Thu Jul 9 18:24:03 CEST 2015


I hope it will, but in addition to "curried" funs:

fun f(2)/1 == fun(Y) -> f(2, Y) end.

Thus:

3 |> fun f(2)/1  == -1





Cheers,
-- 
Pierre Fenoll


On 9 July 2015 at 08:38, Tristan Sloughter <t@REDACTED> wrote:

> Yea yea, Fred pointed out a typo:
>
> f(X) ->
>     fun(Y) -> X + Y end.
>
> f(X, Y) ->
>     X - Y.
>
> 3 |> f(2).
>
> 5 or 1?
>
> --
>   Tristan Sloughter
>   t@REDACTED
>
> On Thu, Jul 9, 2015, at 10:35 AM, Tristan Sloughter wrote:
> > I hope not. Take this code for example
> >
> > f(X) ->
> >     g(Y) -> X + Y end.
> >
> > f(X, Y) ->
> >     X - Y.
> >
> > 3 |> f(2).
> >
> > 5 or 1?
> >
> > --
> >   Tristan Sloughter
> >   t@REDACTED
> >
> > On Thu, Jul 9, 2015, at 10:24 AM, Volkert wrote:
> > > Dear all,
> > >
> > > I really love the Pipe Operator |> in Elixir and F#.
> > >
> > > Are there any plans to have this in Erlang?
> > >
> > > Volkert
> > >
> > >
> > >
> > > _______________________________________________
> > > erlang-questions mailing list
> > > erlang-questions@REDACTED
> > > http://erlang.org/mailman/listinfo/erlang-questions
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150709/dc85adb6/attachment.htm>


More information about the erlang-questions mailing list