Hiding module *exports*

David Feuer david.feuer at gmail.com
Mon Oct 27 16:56:59 UTC 2014


+1.

On Sun, Oct 26, 2014 at 3:28 PM, Tom Murphy <amindfv at gmail.com> wrote:

> (Not to be confused with the "hiding import behavior" discussion also
> going on)
>
> --
>
> Currently, I'm able to write "module Foo where" to export everything
> defined in Foo.
>
> If, though, I add to the module some definitions which I don't want to
> export...
>
>     data Lockbox = MkLockbox Int
>
>     internalFunction = ...
>
> ...I then have to explicitly enumerate everything that I *do* want the
> module to export, and add to that list each time I add to the module.
>
> I propose that instead, we're able to simply say what we mean:
>
>     module Foo hiding (Lockbox(MkLockbox), internalFunction) where
>
> I think its semantics are immediately clear to the reader.
>
> 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.
>
> Tom
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20141027/cadc0da9/attachment-0001.html>


More information about the Glasgow-haskell-users mailing list