Possible Duplicate:
Currying subtraction
I started my first haskell project that is not from a tutorial, and of course I stumble on the simplest things.
I have the following code:
moveUp y = modifyMVar_ y $ return . (+1)
moveDn y = modifyMVar_ y $ return . (-1)
It took me some time to understand why my code wouldn't compile: I had used (-1) which is seen as negative one. Bracketting the minus doesn't help as it prefixes it and makes 1 its first parameter.
In short, what is the point free version of this?
dec :: Num a => a -> a
dec x = x - 1