[Haskell-cafe] mutually recursive modules

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Fri Sep 24 08:59:54 EDT 2004

Henning Thielemann <iakd0 at clusterf.urz.uni-halle.de> writes:

> As far as can see neither Hugs or GHC really support them. Is this still
> on the to-do list or is it almost dropped due to implementation
> difficulties? 

Hugs doesn't support mutually-recursive modules at all.  Ghc and nhc98
support them only if you hand-write a .hi-boot file to bootstrap the
compilation.  I would guess that better support from the mainstream
implementations is unlikely, because it would be a large amount of
effort for a situation which occurs only very rarely, and for which
there is a relatively easy workaround.

Some lesser-known Haskell implementations do fully support
mutually-recursive modules however.  hhc (formerly Freja, from
Henrik Nilsson) allows multiple modules to be stored in a single
file, and hence mutual recursion can be achieved by ensuring all the
recursive modules are compiled simultaneously from the same file.
The PacSoft Haskell system (from the Programatica project at OGI)
also fully supports mutually recursive modules, and I believe they
can even be in separate files.


More information about the Haskell-Cafe mailing list