Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: Why is separate compilation important? I'm a little shocked that anyone on this list should have to ask this question. Two people have asked it now. The simplest answer is that unless

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Henning Thielemann
On Wed, 13 Aug 2008, Thomas Davie wrote: On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote: Quoting Thomas Davie [EMAIL PROTECTED]: Why is separate compilation important? I'm a little shocked that anyone on this list should have to ask this question. Two people have asked it now.

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 11:10, Henning Thielemann wrote: On Wed, 13 Aug 2008, Thomas Davie wrote: On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote: Quoting Thomas Davie [EMAIL PROTECTED]: Why is separate compilation important? I'm a little shocked that anyone on this list should have to ask

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread C.M.Brown
Andrew, [...] For the record, I have no problem with modules depending on each other, so long as they only depend on their well-defined interfaces. Finally, as chris suggests, if separate compilation is important to you, why not have a flag in ghc -frequire-hi-boot or something? Well,

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread ajb
G'day all. Quoting C.M.Brown [EMAIL PROTECTED]: But isn't this exactly the point I was trying to make!? The whole point, to me, in functional programming, is that we shouldn't have to worry about the underlying implementation. It is not exposing an underlying implementation detail to mandate

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread C.M.Brown
Andrew, But isn't this exactly the point I was trying to make!? The whole point, to me, in functional programming, is that we shouldn't have to worry about the underlying implementation. It is not exposing an underlying implementation detail to mandate that modules should have

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread ajb
G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: To be honest, ghc compiles things so fast (at least on any of my systems) that I couldn't care less if it took 10 times as long (I would however like some added convenience for that time spent) Have you ever compiled GHC itself? Just

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 13:18, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: To be honest, ghc compiles things so fast (at least on any of my systems) that I couldn't care less if it took 10 times as long (I would however like some added convenience for that time

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread ajb
G'day. Quoting C.M.Brown [EMAIL PROTECTED]: However I saw no real argument for not having cyclic inclusions. You say we shouldn't have to spend time writing hi-boot files, and yet you also think that GHC should not do it automatically. So we have to restrict all programmers to never

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Iavor Diatchki
Hello, The Haskell'98 report does not specify if/how recursive modules should work. I wrote a paper a long time ago that formalizes and implements this feature (http://www.purely-functional.net/yav/publications/modules98.pdf). I very much doubt that separate compilation is much of a problem in

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread C.M.Brown
Andrew, Thanks very much for your reponse. It was very helpful; this makes a lot of sense! Regards, Chris. On Mon, 11 Aug 2008 [EMAIL PROTECTED] wrote: G'day all. Quoting C.M.Brown [EMAIL PROTECTED]: Yes, I saw that, thanks! I guess this is because it's hard to compile a mutually

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread Thomas Davie
On 12 Aug 2008, at 11:59, C.M.Brown wrote: Andrew, Thanks very much for your reponse. It was very helpful; this makes a lot of sense! And yes, some people think that this is a bug in the specification. I'm not sure that it does make a lot of sense -- we allow (mutually) recursive

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread C.M.Brown
I'm not sure that it does make a lot of sense -- we allow (mutually) recursive functions, even though they come with an efficiency penalty. Why should we not allow (mutually) recursive modules, even though they too come with an efficiency penalty. This is even an example where the

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread ajb
G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: I'm not sure that it does make a lot of sense -- we allow (mutually) recursive functions, even though they come with an efficiency penalty. Why should we not allow (mutually) recursive modules, even though they too come with an efficiency

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread Henning Thielemann
On Tue, 12 Aug 2008, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: I'm not sure that it does make a lot of sense -- we allow (mutually) recursive functions, even though they come with an efficiency penalty. Why should we not allow (mutually) recursive modules,

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread Thomas Davie
On 12 Aug 2008, at 16:01, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: I'm not sure that it does make a lot of sense -- we allow (mutually) recursive functions, even though they come with an efficiency penalty. Why should we not allow (mutually) recursive

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread C.M.Brown
The problem is not mutually recursive modules. Plenty of statically typed languages support mutually recursive modules. The problem is that it's impossible in general to say what the interface of a module is by examining the module alone. This is a very unusual property as real-world

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread Isaac Dupree
C.M.Brown wrote: I don't really see this as being any kind of real issue at all. Surely all GHC needs to do is to concatenate all the modules together, alpha-reduce the import/export relations and do a compile/type check over the concatenated module. FWIW, I agree (in principle -- I haven't

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread ajb
G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: Why is separate compilation important? I'm a little shocked that anyone on this list should have to ask this question. Two people have asked it now. The simplest answer is that unless your program fits in cache, it takes longer to compile

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread ajb
G'day all. Quoting Henning Thielemann [EMAIL PROTECTED]: As far as I know the real difficulties come from mutually recursive class definitions. I wouldn't be surprised, because that's a more blatant instance of the same problem. With classes and instances, there is no way to specify whether

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-11 Thread Don Stewart
cmb21: Hi, I have a question about cyclic inclusions. It appears in the Haskell 98 report that mutually recursive modules are allowed, however GHC complains at any Haskell project that has cyclic inclusions (implicit or explicit). Am I right in thinking that this is a GHC limitation?

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-11 Thread C.M.Brown
Hi Don, GHC provides a mechanism to support mutually recursive modules, but you must break the cycle manually, via a boot file. http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion Yes, I saw that, thanks! I guess this is because it's

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-11 Thread ajb
G'day all. Quoting C.M.Brown [EMAIL PROTECTED]: Yes, I saw that, thanks! I guess this is because it's hard to compile a mutually recursive module... It's because you don't need to declare the types of exported definitions. Consider, this highly artificial example: module A where