Hiding module *exports*

Alois Cochard alois.cochard at gmail.com
Mon Oct 27 11:39:06 UTC 2014


+1 from me

I was looking for the feature a few times.

On 26 October 2014 19:28, 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
>
>


-- 
*Λ\ois*
http://twitter.com/aloiscochard
http://github.com/aloiscochard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20141027/066502ad/attachment.html>


More information about the Glasgow-haskell-users mailing list