[Haskell-cafe] module export question

Sean McLaughlin seanmcl at gmail.com
Tue Dec 1 17:11:42 EST 2009


Say I have the following module:

----------------------------------------
module A
  ( T(T)
  , t
  , val
  )
where

data T = T { t :: Int }

val :: T
val = T 7
----------------------------------------


When I use A with the following imports, I don't expect this to work,
but it does:

import qualified A
import A(T(..))

main = putStrLn $ show $ t A.val

The problem is that I explicitly didn't export 't' as an element of T
(by not writing T(..)).
Am I just misunderstanding how exports work?  I couldn't figure out
what the correct
behavior should be by looking at the 98 report.

Sean


More information about the Haskell-Cafe mailing list