Hiding module *exports*

Erik Hesselink hesselink at gmail.com
Mon Oct 27 13:57:17 UTC 2014


On Mon, Oct 27, 2014 at 2:41 PM, Daniel Trstenjak
<daniel.trstenjak at gmail.com> wrote:
>> There's a little bit of bikeshedding that needs to happen (e.g. is "hiding (Foo
>> (..))" sufficient to hide the type Foo and not just its constructors), but are
>> people +1 on this? I've frequently wanted this behavior.
>
> I would be surprised if 'Foo(..)' would mean in this case something
> different, so yes, the type Foo should be hidden too.

One related question: how would you export only the type if you have

    newtype Foo = Foo ...

which is a pretty common pattern? Since "hiding (Foo(Foo))" would also
hide the type, I don't see many options, which is unfortunate.

In general, I'm +1 on the proposal.

Erik


More information about the Glasgow-haskell-users mailing list