illegal export of lone data constructor

Ian Lynagh igloo at earth.li
Wed Sep 17 14:49:09 EDT 2003


On Sat, Sep 13, 2003 at 04:57:34PM +0200, Andrew Frank wrote:
> i am moving fom the nov 99 to the nov 02 hugs.exe (under windows)
> when recompiling old files i find two problems which i do not understand:
> 
> i want to export (:) from the prelude because i do not use the standard
> prelude usually.
> 
> module XX ( (:), ....)
> does not work (it did before). now i get the error "illegal export of lone
> data constructor"
> i do not see any hint in the report (nov 99) that (:) cannot be exported.
> (it may be unusual, but not illegal?)

http://www.haskell.org/onlinereport/syntax-iso.html does not permit an
export of (:) as : is not a valid varsym (as : is not a valid symbol).

Even for something like []((:)) the grammar says (:) would have to be a
cname (= var | con) or qvar whereas it is a qcon (so the : is a gconsym.
Of course, the [] bit isn't valid either.

> the goal is to export certain functions from the prelude (especially (:),
> which cannot be redefined) but not all of it. how can this be achieved?

I would have expected list syntax to work regardless of whether you
imported it from the Prelude as it cannot be redefined - is that not the
case? (I haven't actually tried to do anything like that myself).


Thanks
Ian



More information about the Hugs-Bugs mailing list