[Haskell-beginners] Why must inflix constructors begin with a colon?

Francesco Ariis fa-ml at ariis.it
Thu Dec 31 13:33:06 UTC 2015


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.


More information about the Beginners mailing list