Mutually recursive modules

Simon Peyton-Jones simonpj at microsoft.com
Fri Jun 6 03:49:39 EDT 2008


Richard

I'm assuming you have ready the GHC manual?
http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion

Yes, mutually recursive modules are fine (in GHC anyway), and should work as advertised there.  Please do produce a test case if not.

Thanks

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-users-bounces at haskell.org] On
| Behalf Of Richard Giraud
| Sent: 05 June 2008 22:46
| To: GHC Users Mailing List
| Subject: Mutually recursive modules
|
| Hello
|
| I've been doing some work with mutually recursive modules (MRMs).  I'm
| familiar with the section in the User's Guide on how to do this and have
| successfully worked with MRMs with simple dependencies.  However, I have
| created a set of MRMs that I can't seem to get to compile because of
| type issues.
|
| I can get the code to compile by combining all of the modules into a
| single, monolithic module; however, this breaks the conceptual design
| that I'm going for.  I may also be able to break the modules into
| smaller pieces that will compile, though I'm not sure about this and it,
| too, would break the conceptual design.
|
| Does the current {-# SOURCE #-}/.hs-boot scheme allow for compilation of
| arbitrary MRMs?  Or are there known cases where it doesn't work?  If
| there are cases where it doesn't work, are there other options?
|
| Someone in Haskell Cafe mentioned that GHC 6.2 used a different scheme
| for MRMs (.hi-boot).  Is it still possible to use this?  Would it allow
| for compilation of arbitrary MRMs?
|
| I can create a minimal case as an example, if it would be useful.
|
| Thanks,
|
| Richard
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list