Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread ajb
G'day all. Quoting Henning Thielemann <[EMAIL PROTECTED]>: > Why can't GHC and Hugs go this way? As Alastair noted, the problem is that Haskell allows you to export symbols from a module whose types are unknown unless you type-check modules that it imports. Simple example: module A where

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Alastair Reid
Alastair: > A crude approach is to assume the type (\forall a. a) for any > function with no prototype Andreas: > Huh? How can that ever be sound? You're right, it's not - my mistake. I guess that leaves two options: 1) Insist on a prototype for any exported function. 2) Insist on a prototype

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Jan-Willem Maessen
An anecdotal note - hbcc (the front end to the pH and Eager Haskell compilers, and also of GRIN) contained several mutually recursive modules both in the compiler and in the prelude. One of the best things we ever did was get rid of the mutual recursion. The resulting refactoring helped us to gr

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Henning Thielemann
On Fri, 24 Sep 2004, Malcolm Wallace wrote: > The main obstacle is that Haskell systems generally process one > file/module at a time. To extract an interface from each module > first, before further processing, would not only require a second > pass over the source files, but to load all of the

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Andreas Rossberg
Alastair Reid wrote: Generating .hiboot files by just deleting function definitions fails if there is no prototype for an exported function. A crude approach is to assume the type (\forall a. a) for any function with no prototype but, although this is sound (I think), it will cause valid progra

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Alastair Reid
The original Haskell design included interface files usually with names like Main.hi IIRC, Yale Haskell expected them to be hand-written while HBC and GHC machine-generated but allowed the careful user to write them by hand. Sometime around Haskell 1.4 or 98, they were dropped because Yale Haske

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Malcolm Wallace
Henning Thielemann <[EMAIL PROTECTED]> writes: > >a situation which occurs only very rarely, and for which > > there is a relatively easy workaround. > > Namely? ... See below. > It's interesting how other languages solve this problem. In Modula-3 it > is solved by explicit module

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Malcolm Wallace
Henning Thielemann <[EMAIL PROTECTED]> 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

Re: [Haskell-cafe] mutually recursive modules

2004-09-24 Thread Henning Thielemann
On Fri, 24 Sep 2004, Malcolm Wallace wrote: > 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

[Haskell-cafe] mutually recursive modules

2004-09-24 Thread Henning Thielemann
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? ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe