[Haskell-cafe] Custom unary operator extension?
Peter Verswyvelen
bf3 at telenet.be
Sun Sep 9 05:22:30 EDT 2007
I find it unfortunate that one can't (I guess) define custom unary
operators in Haskell.
Is this correct? If so, is this just because eg (* 100) declares a
function that partially applies the * operator, so this syntax disallows
unary operators? Could this be fixed by introducing a different syntax
for partial operator application? E.g. (? * 100) instead of just (*100)?
This would also fix the ambiguity between (-10) as being either the
number minus 10 or the "subtract by 10' function.
Cheers,
Peter
More information about the Haskell-Cafe
mailing list