by codesnik · 3y ago · 0 comments
Enum.map(list, func)
This is backwards to how partial application works: def mapper(func), do: Enum.map(func)
incrementer = mapper(fn x -> x + 1 end)
incrementer(list)
It's not the end of the world to not have it this way, but it removes a lot of patterns that are common in other functional languages.If you did however, swapping the arguments would break most partial application patterns you see in languages like Haskell, OCaml, Elm and even JS.
I think there are many more severe problems with Elixir which make it not even a remotely functional PL for me (rather, procedural + macros), but arguments order is not one of them.
But the jury is definitely still out for if the pattern of showing it in syntax and semantics actually is beneficial. And yes, I know nearly all the examples you can come with to show how useful it can be.
But the cost of having it seems to more than compensate the benefits.