[Haskell-cafe] alphanum in infix constructors (and possibly functions as well) - why not?

Ozgur Akgun ozgurakgun at gmail.com
Fri Jun 4 07:22:07 EDT 2010


Hi all,

The constructor names in Haskell need to obey one of the two following
rules:
 - either starts with a capital letter and contains alphanumeric characters
afterwards, (including _ I guess)
 - or starts with a colon (:) and only contains symbols afterwards

The first one is used Prefix by default, and the second ose is used infix by
default.

What stops us from allowing alphanum characters appear in the Infix version
(after the colon)? Can't it be relaxed to only start woth a colon?

So I want to be able to say something like:

data Expr = Expr :<   Expr          -- checks for LT betwen two Expr's
          | Expr :<2  Expr          -- a different implementation of the
same thing maybe
          | Expr :<veryfast Expr    -- and the veryfast implementation of it

(just a silly example I could think of now.)


Best,
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100604/40d91645/attachment.html


More information about the Haskell-Cafe mailing list