Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was going off what platz said in another comment, that |> flips the arguments to |> in the same way Haskells flip function does, which I thought the type signature of the the F# |> also indicated. I'm sorry if I'm misunderstanding things.

I think the difference though is that the |> in Elixir is actually a macro that modifies the following function call's first argument.

So list |> Enum.filter(&(&1 > 0)) doesn't end up using filter as a curried function as one would find in Haskell:

Enum.filter(&(&1 > 0)) list

The end result is actually:

Enum.filter(list, &(&1 > 0))



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: