[Haskell-cafe] Module visibility of data type constructors

Slavomir Kaslev slavomir.kaslev at gmail.com
Sat Nov 4 14:39:39 EST 2006

Hello. I have a simple question for data type constructors visibility.
Take a look:

module Foo (Bar) where
data Bar = Bar

In ghc this allows me to use Bar, the type constructor, in another
module, although it shouldn't be visible outside Foo. On the other
hand, if I change Bar's definition as:

data Bar = Baz

Baz isn't visible outside Foo.

Is this the correct behavior or is it bug in ghc?


Slavomir Kaslev

More information about the Haskell-Cafe mailing list