[Haskell-cafe] Custom unary operator extension?
Peter Verswyvelen
bf3 at telenet.be
Sun Sep 9 17:34:30 EDT 2007
Henning Thielemann wrote:
> The more syntactic constructs exist, the more complicated it becomes
> to read such programs. Today, if you read a symbolic operator which is
> not "-", not a single dot with a capital identifier to the left
> (qualification), not a double dot in a bracket (enumeration) and not
> enclosed in parentheses (prefix mode), then it is an infix operator.
> Note the already existing exceptions, and I feel these are not
> complete. With prefix operators it becomes more difficult.
Okay, so the choice was to enhance readability. Yes, something can be
said for that, because in C++ and C#, operator overloading is a no-go in
general, in those language, it is prefered to use clear and long
function names. But as Haskell seemed more math-mind oriented, I was
just wandering why unary operator support was missing. Since students
will surely ask me why I can't create a symbolic operator for the "not"
function, I now have a good answer ready ;-)
Thanks,
Peter
More information about the Haskell-Cafe
mailing list