
17 Aug
2006
17 Aug
'06
4:52 a.m.
On 17/08/06, Tamas K Papp
The code in the subject generates an error. I understand why this is (- is treated as part of the number), but I don't know how to solve it, ie how to tell Haskell that - is a function/binary operator?
There's a Prelude function for exactly this purpose, which leads your code still quite readable: Prelude> map (subtract 2) [1..5] [-1,0,1,2,3] -- -David House, dmhouse@gmail.com