[Haskell-cafe] Strange subtract operator behavior

Neil Mitchell ndmitchell at gmail.com
Tue Oct 16 12:02:48 EDT 2007


>  (/ 10) means the function that divides its argument by 10
>  (- 10) however is just the number -10, even if I put a space between the -
> and 10.
>  How can I create a function that subtracts 10 from its argument in a clean
> way then?

subtract is the way to go. (`subtract` 10)

I think you should have to write negative numbers using the syntax
0-10, since currently having one single unary operator is ugly.



More information about the Haskell-Cafe mailing list