Why must inflix constructors begin with a colon?

I'm new to Haskell and wondering why this restriction? For example (from LYH): infixr 5 :-: data List a = Empty | a :-: (List a) deriving (Show, Read, Eq, Ord) Thanks, - Olumide

On Thu, Dec 31, 2015 at 12:52:44PM +0000, Olumide wrote:
I'm new to Haskell and wondering why this restriction?
For example (from LYH):
infixr 5 :-: data List a = Empty | a :-: (List a) deriving (Show, Read, Eq, Ord)
Not a committee member, but there is a similar restriction (dichotomy, rather) with 'functions' (first char lowercase) and 'constructors' (first char uppercase), so mirroring it to infix operators/constructors seems reasonable.

I'm not a member of the commitee either, but I do think it is to make the
grammar context free and give the parser an easy way to distinguish.
Because of the design as it is now, already a lexer can decide whether we
have a function or an constructor operator.
Francesco Ariis
On Thu, Dec 31, 2015 at 12:52:44PM +0000, Olumide wrote:
I'm new to Haskell and wondering why this restriction?
For example (from LYH):
infixr 5 :-: data List a = Empty | a :-: (List a) deriving (Show, Read, Eq, Ord)
Not a committee member, but there is a similar restriction (dichotomy, rather) with 'functions' (first char lowercase) and 'constructors' (first char uppercase), so mirroring it to infix operators/constructors seems reasonable. _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
participants (3)
-
Francesco Ariis
-
Norbert Melzer
-
Olumide