I recently ran into following problem: Given a list of numbers, I want to subtract a constant from every entry of this list. The natural but wrong thing to do is
map (-3) [5,6,7]
Here the -
is not interpreted a binary function but as an unary negation operator.
I found following workarounds:
map (+(-3)) [5,6,7]
map ((+)(-3)) [5,6,7]
map (flip (-) 3) [5,6,7]
Question : Is there a more elegant way to do this that avoids this unnecessary pile of parenthesis?