Search code examples
elmpartial-application

How do I partially apply an infix function like Basics.+?


All of the examples I've seen so far create a "wrapper" function around Basics.+ and then partially apply that:

sum x y = 
  x + y

plusOne =
  sum 1

However, I'm sure that there's a way to avoid the extra wrapping.


Solution

  • Wrap it in parenthesis

    plusOne =
      (+) 1