RE: Prelude and (:) and []((:), []) bugs?
Ian Lynagh writes:
On Thu, Sep 20, 2001 at 01:32:54PM +0100, Simon Marlow wrote:
(:) is allowed in an export list; it is just a normal operator.
An export is
export -> qvar | qtycon [(..) | ( qcname1 , ... , qcnamen )] (n>=0) | qtycls [(..) | ( qvar1 , ... , qvarn )] (n>=0) | module modid
and we need to match (:). We can clearly reduce this to [ proof that this isn't possible deleted ]
Ah, I forgot that you can't export a constructor on its own. In which case, I would like to submit a bug report for Hugs: Hugs allows constructors to be named in an export list, and it shouldn't (see Section 5.2 in The Report, point 2 in the enumerated list). Cheers, Simon
Ah, I forgot that you can't export a constructor on its own.
You can't? I probably knew this once but looking at it now, it seems kinda surprising. Haskell's module system is supposed to be just namespace control --nothing more-- so why is it preventing me from doing something which is perfectly safe and well-defined? I'll readily agree that there's no strong motivation for exporting a constructor on its own (I think the only reason Hugs allows it is just so we can export (:) from the Prelude) but what is the motivation for disallowing it? -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
participants (2)
-
Alastair David Reid -
Simon Marlow