[Haskell-cafe] Module visibility of data type constructors

Slavomir Kaslev slavomir.kaslev at gmail.com
Sat Nov 4 16:19:08 EST 2006


On 11/4/06, Matthias Fischmann <fis at wiwi.hu-berlin.de> wrote:
>
> On Sat, Nov 04, 2006 at 09:39:39PM +0200, Slavomir Kaslev wrote:
> > To: haskell-cafe at haskell.org
> > From: Slavomir Kaslev <slavomir.kaslev at gmail.com>
> > Date: Sat, 4 Nov 2006 21:39:39 +0200
> > Subject: [Haskell-cafe] Module visibility of data type constructors
> >
> > 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?
>
> It's not the correct behavior.  The question is whether the bug is in
> your code or in ghc (with me it's usually the former :-).
>
> I can't reproduce this with my ghc 6.4.  Which version are you using?
> Can you post the other module you are talking about?
>
>
> matthias
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFFTPl+TXPx/Y0ym6oRAibjAJ9uG6ZP37xOnCRRRAaraewnCn/tmQCgkZB/
> xLL/q1iDHAhBUCuojOZsvuA=
> =jWQR
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>

Actually you're right. It was my mistake, I don't know what tricked me.

I was evaluating in ghci, not noticing even (silly me) *Foo>.

Sorry for the noise. I probably need some more coffe in this time of the day.

-- 
Slavomir Kaslev


More information about the Haskell-Cafe mailing list