wende / elchemy

Write Elixir code using statically-typed Elm-like syntax (compatible with Elm tooling)
https://wende.github.io/elchemy/
MIT License
1.15k stars 28 forks source link

Pipes require the function to be curried when they don't need to #332

Closed wende closed 6 years ago

wende commented 6 years ago

Add: Uncurry for functions that are piped to with arity n - 1

Example:

myFun a b = 1

test =
  1
  |> myFun 2

->

def test()
  1
  |> (myFun().(2)).()
end

instead of

def test()
  1
  |> myFun(2)
end
wende commented 6 years ago

Actually they do need to since pipes work differently in Elm than Elixir (last vs first)