[Haskell-beginners] question about shared data types
Brent Yorgey
byorgey at seas.upenn.edu
Mon Apr 29 15:44:57 CEST 2013
On Mon, Apr 29, 2013 at 11:28:03AM +0100, Ian Knopke wrote:
>
> I've been including newtype Foo in a Common.hs module that is
> included in both, as I would in C or C++. This sort of thing can easily get
> more complicated as the program grows however.
That is exactly what I would do, and is a common practice. For
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.
I am not sure what you mean when you say that this can get complicated
as the program grows. I have some fairly large packages using this
technique and in practice I have not seen much complication. Can you
give an example of the sort of complication you mean?
-Brent
More information about the Beginners
mailing list