I am learning Haskell now, I am just really curious about this. for example:
minus :: Int -> Int -> Int -> Int
minus x y z = x - y - z
what if I wanna pass y to the function [minus] first instead of x? I want a function [minus x 5 z] I don't want this
minusy10 x z = minus x 10 z
if I have to define a new function to achieve this, I feel like it lost some "Haskell elegance".
Your
minus10is a very idiomatic way to do it; often this is bound inside awhereclause so that it doesn't clutter the top-level API.flip minus 10and(`minus` 10)are also common choices. Those two choices work only for filling in the second argument; more generally, to fill in an nth argument, lambdas generalize better, as in\x -> minus x 10.