Hiding module *exports*

amindfv at gmail.com amindfv at gmail.com
Mon Oct 27 14:15:28 UTC 2014


El Oct 27, 2014, a las 9:57, Erik Hesselink <hesselink at gmail.com> escribió:

> 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.
> 

I'd say "hiding (Foo)" hides the type and constructor; "hiding (Foo(Foo))" hides only the constructor.

Tom


> Erik
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list