[Haskell-beginners] question about shared data types

Federico Mastellone fmaste at gmail.com
Tue Apr 30 05:52:31 CEST 2013


Common practice are the Common.hs, Types.hs or Internal.hs modules with the internally shared code of your package.

Just import them on modules Aaa and Bbb and reexport what is needed by the users of those modules so they can write only one import declaration.

Look at http://hackage.haskell.org/packages/archive/binary/0.7.0.1/doc/html/Data-Binary-Builder-Internal.html and http://hackage.haskell.org/packages/archive/blaze-builder/0.3.1.1/doc/html/Blaze-ByteString-Builder.html (the Builder type is in Blaze.ByteString.Builder.Internal.Types and is used everywhere).

On Apr 29, 2013, at 10:44 AM, Brent Yorgey <byorgey at seas.upenn.edu> wrote:

> 
> example, you will often see a module named something like
> 'Foo.Bar.Types' which contains declarations of common types which are
> used in many other modules.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130430/4bfa7c05/attachment.htm>


More information about the Beginners mailing list