There is a difference between hugs and ghc in how they treat imports with the '(..)' notation. Here's my example:
module CTree( --other stuff Const(..) ) where
import ATree (Const)
--const has constructors CInt, CChar, CStr
under hugs this module exports CInt, CChar, CStr but under ghc it does not. Under ghc it only exports the constructors if I import 'Const' like this:
import ATree (Const(..))
I don't know which is the right behaviour w.r.t. the H98 standard, but it 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
On 2002.02.18 11:11:08 +0000 Simon Marlow wrote:
There is a difference between hugs and ghc in how they treat imports with the '(..)' notation. Here's my example:
module CTree( --other stuff Const(..) ) where
import ATree (Const)
--const has constructors CInt, CChar, CStr
under hugs this module exports CInt, CChar, CStr but under ghc it does not. Under ghc it only exports the constructors if I import 'Const' like this:
import ATree (Const(..))
I don't know which is the right behaviour w.r.t. the H98 standard, but it 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*.
I just tested this with the hugs December 2001 version and it still exhibits this behaviour. Hopefully this can be added to some 'bug list' somewhere. Duncan
participants (2)
-
Duncan Coutts -
Simon Marlow