> the grammar for import and export lists use `tycon'
> and `qtycon' (respectively) rather than `gtycon'.
>
> Is there any particular reason for this, or is this
> just a defect in the Haskell 98 report?
> Would changing `qtycon' to `gtycon' in the
> grammar production for `export' cause any problems?
> Likewise, how about changing `tycon' in the grammar
> production for `import' to say `gutycon', defined by
>
> gutycon -> tycon
> | () (unit type)
> | [] (list constructor)
> | (->) (function constructor)
> | (,{,}) (tupling constructors)
>
> ?
I believe this has been noticed before, but hasn't been fixed because simply
making the above change wouldn't solve the whole problem: there's still no
way to qualify these identifiers as eg. Prelude.(,). And fixing this would
involve importing knowledge about these names into the lexical syntax, which
would be rather ugly. But perhaps that's the only way.
> The good news is that ghc (4.04) does not follow the Haskell 98
> report -- it accepts the following code, apparently as an
> extension to Haskell 98 (even without `-fglasgow-exts'):
>
> module Example(Prelude.[](..)) where
> import Prelude([](..))
>
> Similarly, it also accepts
>
> module Example(Prelude.[]((:), [])) where
> import Prelude([]((:), []))
Yes, GHC accepts the syntax 'Prelude.[]' (and friends, including
Prelude.->) as an extension.
Cheers,
Simon