[Haskell-cafe] what I learnt from my first serious haskell programm

Robert Dockins robdockins at fastmail.fm
Mon Mar 19 11:24:09 EDT 2007

On Mar 19, 2007, at 9:56 AM, Henning Thielemann wrote:

> On Mon, 19 Mar 2007, Fawzi Mohamed wrote:
>>> A practice I've seen a lot in small- to mid-sized programs is to  
>>> have
>>> a Types module that contains definitions of the types used in the
>>> program.
>> ok I will think about it
> I'd avoid that and suggest a more decentralized design, where each  
> module
> contributes one main type and according functions.

I'd just like to mention that I've used the central "Types" module  
myself on occasion.  The main reason is to avoid the need for  
mutually recursive modules, and not because its a particularly nice  
design.  I try to arrange the user-visible API around some coherent  
organizing principle, such as the one Henning proposes, but that  
sometimes leads to module dependency cycles; factoring out a Types  
module is one way to break the cycles.

Rob Dockins

Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
           -- TMBG

More information about the Haskell-Cafe mailing list