prelude.ls

prelude.ls |> with multiple argument


Is it possible to use |> with multiple arguments?

sum = (a, b)-> 
  a + b

10, 12 |> sum # "Unexpected ','" 
sum(10,12) # this is fine
10 |> sum 12, _ # this works, but is there a better way? 

Solution

  • You can't pipe |> in more than one argument at a time.

    10 |> sum 12 works fine however.

    PS. you could write sum = (+)