> GHC's lexer (function Lex.mk_var_token) treats names starting with
> an underscore followed by an uppercase letter as a constructor (conid)
> and not as a variable (varid):
> 
>    module Foo where
>    data T = _ThisWorksAlthoughItShouldNot
>    _ThisShouldWorkButItDoesNot = '?'
> 
> A comment in the source code tells something about syntax in interface
> files, but I don't have clue... Could somebody (SimonM?) explain why
> this is done that way?

It used to be needed to deal with compiler-generated constructors, eg.  we
used to name dictionary constructors things like _DOrdInt so as not to clash
with the user namespace.  It isn't necessary any more, now that the
namespaces are separated in a more robust fashion.

I've removed the hack in Lex.lhs.  Thanks for the report...

Simon

Reply via email to