hugs / ghc difference over '(..)' imports
Simon Marlow
simonmar@microsoft.com
Mon, 18 Feb 2002 11:11:08 -0000
> There is a difference between hugs and ghc in how they treat=20
> imports with the=20
> '(..)' notation. Here's my example:
>=20
> module CTree(
> --other stuff
> Const(..)
> ) where
>=20
> import ATree (Const)
>=20
> --const has constructors CInt, CChar, CStr
>=20
> under hugs this module exports CInt, CChar, CStr
> but under ghc it does not. Under ghc it only exports the=20
> constructors if I=20
> import 'Const' like this:
>=20
> import ATree (Const(..))
>=20
> I don't know which is the right behaviour w.r.t. the H98=20
> standard, but it=20
> tripped me up.
GHC is correct here. According to the Haskell 98 report C(..) exports C =
and all its constructors *that are currently in scope*.
Cheers,
Simon