[Haskell-cafe] Mutually recursive modules and google protocol-buffers

Stuart Cook scook0 at gmail.com
Tue Jul 15 11:36:03 EDT 2008


On Wed, Jul 16, 2008 at 12:54 AM, Henning Thielemann
<lemming at henning-thielemann.de> wrote:
> Sooner or later you want generalize your datatypes. Then you can define
>   data A b = A b
>  and you do not need to import B any longer. I do not know if this is a
> generally applicable approach, but it helped me in some cases.

This only really works if it's "natural" for A to be polymorphic in b.
Otherwise you end up with all sorts of irrelevant administrative type
parameters polluting your signatures.

(I recently had a similar problem with mutually recursive modules; I
ended up deciding to write my program in not-Haskell instead, which
made me a little sad.)


Stuart


More information about the Haskell-Cafe mailing list