Partial application in Haskell with multiple arguments
Given some function f(x1,x2,x3,..,xN) it is often useful to apply it partially in several places. For example, for N=3 we could define g(x)=f(1,x,3). However, the standard partial application in Haskell does not work this way and only allows us to partially apply a function by fixing its first arguments (because all functions actually only take one argument). Is there any simple way to do something like this: g = f _ 2 _ g 1 3 with output the value of f 1 2 3 ? Of course we could do a lambda-function g=(\x1 x3 -> f x1 2 x3) but I find this quite unreadable. For example, in Mathematica it works