Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Export of names only for testing (Baa) 2. Re: Export of names only for testing (David McBride) 3. Re: Export of names only for testing (Baa) 4. Re: Export of names only for testing (David McBride) ---------------------------------------------------------------------- Message: 1 Date: Mon, 2 Oct 2017 12:28:18 +0300 From: Baa <aqua...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: [Haskell-beginners] Export of names only for testing Message-ID: <20171002122818.50bd85d0@Pavel> Content-Type: text/plain; charset=US-ASCII Hello, All! What is the standard Haskell convenience about export of module names for testing? As I understand, I should export all of them which looks like abstraction leak, but without this I can't test them, right? === Best regards, Paul ------------------------------ Message: 2 Date: Mon, 2 Oct 2017 06:39:31 -0400 From: David McBride <toa...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Export of names only for testing Message-ID: <CAN+Tr40L=vgfi+oso-8jerajsrnzgrr6jei5gzij6uvdzgo...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" It is common to export an Foo.Internal module that has the internals of your library in it, with a doc at the top that this is meant for internal use. It can be used both for testing and sometimes the user of your library can do something with it you didn't think of if he has access to the internals. On Mon, Oct 2, 2017 at 5:28 AM, Baa <aqua...@gmail.com> wrote: > Hello, All! > > What is the standard Haskell convenience about export of module names for > testing? As I understand, I should export all of them which looks like > abstraction leak, but without this I can't test them, right? > > === > Best regards, Paul > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20171002/eb87adae/attachment-0001.html> ------------------------------ Message: 3 Date: Mon, 2 Oct 2017 13:49:07 +0300 From: Baa <aqua...@gmail.com> To: beginners@haskell.org Subject: Re: [Haskell-beginners] Export of names only for testing Message-ID: <20171002134907.130b5d75@Pavel> Content-Type: text/plain; charset=US-ASCII > It is common to export an Foo.Internal module that has the internals > of your library in it, with a doc at the top that this is meant for > internal use. It can be used both for testing and sometimes the user > of your library can do something with it you didn't think of if he > has access to the internals. Hm, but if I have 10 modules in src/ (m1.hs, ..., m10.hs) I must create, for example 10 folders like src/m1/, ..., src/m10/ and their individual M*.Internal module, right? So, `m1`, for example, becomes: src/ m1/ Internal.hs All.hs ? And `All.hs` imports and re-exports module (or its part only) `Internal.hs`? Something like this? === Best regards, Paul ------------------------------ Message: 4 Date: Mon, 2 Oct 2017 07:12:40 -0400 From: David McBride <toa...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Export of names only for testing Message-ID: <can+tr43desg-k5s2k4xekfb4wjpyfeadhqopgc8dadhyoia...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" All I can give are examples. These have single Internal modules. https://hackage.haskell.org/package/text-1.2.2.2/docs/Data-Text-Internal.html https://hackage.haskell.org/package/aeson-1.2.2.0/docs/Data-Aeson-Internal.html https://hackage.haskell.org/package/pipes-4.3.5/docs/Pipes-Internal.html https://hackage.haskell.org/package/reflex-0.4.0/docs/Reflex-Spider-Internal.html whereas opaleye for example has an entire Internal hierarchy. https://hackage.haskell.org/package/opaleye-0.6.0.0 On Mon, Oct 2, 2017 at 6:49 AM, Baa <aqua...@gmail.com> wrote: > > It is common to export an Foo.Internal module that has the internals > > of your library in it, with a doc at the top that this is meant for > > internal use. It can be used both for testing and sometimes the user > > of your library can do something with it you didn't think of if he > > has access to the internals. > > Hm, but if I have 10 modules in src/ (m1.hs, ..., m10.hs) I must create, > for example 10 folders like src/m1/, ..., src/m10/ and their individual > M*.Internal module, right? So, `m1`, for example, becomes: > > src/ > m1/ > Internal.hs > All.hs > ? > > And `All.hs` imports and re-exports module (or its part only) > `Internal.hs`? Something like this? > > > === > Best regards, Paul > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20171002/069f3a8a/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 112, Issue 2 *****************************************