Re: Prelude not in haskell98?
Iavor Diatchki wrote: Hi, Just curious, what external modules does the Prelude depend on? The only unusual feature that I can think of in the GHC Prelude is the fact that the partial functions throw exceptions, and so perhaps the Prelude implementation uses some extra modules for that? I'm not really sure what you mean by external modules. In GHC the Prelude is comprised almost entirely of re-exports from other modules. You can follow the source code links from the Haddock docs to take a look: http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html One big dependency is that the Prelude exports some I/O functionality, so it pulls in the entire I/O library. Cheers, Simon -Iavor On 6/6/07, Simon Marlow [EMAIL PROTECTED] wrote: Isaac Dupree wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stefan O'Rear wrote: Right, the problem is that if Prelude was in haskell98 then it wouldn't be possible to have a program that /didn't/ depend on haskell98 (short of -fno-implicit-prelude extensions, or having a Prelude in both (which would mean you couldn't depend on both base and haskell98)). There's also a pragmatic reason. Currently it is impossible to have a cycle of module imports cross package boundaries; so if the Prelude was in haskell98, then (since the Prelude depends on non-haskell98 base modules for its implementation) *Nothing* in base could use the prelude. (Assuming haskell98 depends on base currently) It seems we would want haskell98 to re-export base's Prelude. It's just that that's not implemented in released-ghc package management code. Yes, packages that re-export modules would be a useful feature. Then we could have a version of the base package that only exported the compiler-independent modules, for example. Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
Iavor Diatchki wrote: Just curious, what external modules does the Prelude depend on? I'm not really sure what you mean by external modules. In GHC the Prelude is comprised almost entirely of re-exports from other modules. Just to note that, although ghc's inversion of the expected dependency relationship is mildly confusing the first time you come across it, that design decision is not the only one possible. Other compilers, such as nhc98, treat the haskell98 Prelude more like it is specified in the Report, as a stand-alone module that depends on nothing else. In such a compiler, the 'base' package does not (and cannot) contain the Prelude, which necessarily lives at a lower more basic level in the library hierarchy. Regards, Malcolm ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
Isaac Dupree wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stefan O'Rear wrote: Right, the problem is that if Prelude was in haskell98 then it wouldn't be possible to have a program that /didn't/ depend on haskell98 (short of -fno-implicit-prelude extensions, or having a Prelude in both (which would mean you couldn't depend on both base and haskell98)). There's also a pragmatic reason. Currently it is impossible to have a cycle of module imports cross package boundaries; so if the Prelude was in haskell98, then (since the Prelude depends on non-haskell98 base modules for its implementation) *Nothing* in base could use the prelude. (Assuming haskell98 depends on base currently) It seems we would want haskell98 to re-export base's Prelude. It's just that that's not implemented in released-ghc package management code. Yes, packages that re-export modules would be a useful feature. Then we could have a version of the base package that only exported the compiler-independent modules, for example. Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
Hi, Just curious, what external modules does the Prelude depend on? The only unusual feature that I can think of in the GHC Prelude is the fact that the partial functions throw exceptions, and so perhaps the Prelude implementation uses some extra modules for that? -Iavor On 6/6/07, Simon Marlow [EMAIL PROTECTED] wrote: Isaac Dupree wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stefan O'Rear wrote: Right, the problem is that if Prelude was in haskell98 then it wouldn't be possible to have a program that /didn't/ depend on haskell98 (short of -fno-implicit-prelude extensions, or having a Prelude in both (which would mean you couldn't depend on both base and haskell98)). There's also a pragmatic reason. Currently it is impossible to have a cycle of module imports cross package boundaries; so if the Prelude was in haskell98, then (since the Prelude depends on non-haskell98 base modules for its implementation) *Nothing* in base could use the prelude. (Assuming haskell98 depends on base currently) It seems we would want haskell98 to re-export base's Prelude. It's just that that's not implemented in released-ghc package management code. Yes, packages that re-export modules would be a useful feature. Then we could have a version of the base package that only exported the compiler-independent modules, for example. Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Prelude not in haskell98?
Hello, I am using GHC 6.6 and I am trying to build a library using Cabal. The library is written in Haskell'98 so I made the Cabal file depend only on the package haskell98. Unfortunately building the library fails with the following error: MyModule.hs:1:0: Failed to load interface for `Prelude': it is a member of package base, which is hidden The module MyModule does not have any imports (except for the implicitly imported Prelude). If I add an extra dependency on package base, then the library compiles. All this seems to indicate that the Prelude is not a part of the haskell98 package. Is this the case, and if so, is this intentional? It would be nice if we could create Cabal packages that explicitly indicate that the library depends only on Haskell 98 libraries. -Iavor ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
Hi Iavor, All this seems to indicate that the Prelude is not a part of the haskell98 package. Is this the case, and if so, is this intentional? It would be nice if we could create Cabal packages that explicitly indicate that the library depends only on Haskell 98 libraries. Its true, and its intentional. The trend nowadays is to make programs depend only on base, not only on haskell98 - i.e. import System.Environment (and others) instead of System. hakell98 will be around forever, but base is the new standard libraries set. Thanks Neil ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
On Tue, Jun 05, 2007 at 11:23:57PM +0100, Neil Mitchell wrote: All this seems to indicate that the Prelude is not a part of the haskell98 package. Is this the case, and if so, is this intentional? It would be nice if we could create Cabal packages that explicitly indicate that the library depends only on Haskell 98 libraries. Its true, and its intentional. The trend nowadays is to make programs depend only on base, not only on haskell98 - i.e. import System.Environment (and others) instead of System. hakell98 will be around forever, but base is the new standard libraries set. Right, the problem is that if Prelude was in haskell98 then it wouldn't be possible to have a program that /didn't/ depend on haskell98 (short of -fno-implicit-prelude extensions, or having a Prelude in both (which would mean you couldn't depend on both base and haskell98)). Thanks Ian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
On Wed, Jun 06, 2007 at 12:39:20AM +0100, Ian Lynagh wrote: On Tue, Jun 05, 2007 at 11:23:57PM +0100, Neil Mitchell wrote: All this seems to indicate that the Prelude is not a part of the haskell98 package. Is this the case, and if so, is this intentional? It would be nice if we could create Cabal packages that explicitly indicate that the library depends only on Haskell 98 libraries. Its true, and its intentional. The trend nowadays is to make programs depend only on base, not only on haskell98 - i.e. import System.Environment (and others) instead of System. hakell98 will be around forever, but base is the new standard libraries set. Right, the problem is that if Prelude was in haskell98 then it wouldn't be possible to have a program that /didn't/ depend on haskell98 (short of -fno-implicit-prelude extensions, or having a Prelude in both (which would mean you couldn't depend on both base and haskell98)). There's also a pragmatic reason. Currently it is impossible to have a cycle of module imports cross package boundaries; so if the Prelude was in haskell98, then (since the Prelude depends on non-haskell98 base modules for its implementation) *Nothing* in base could use the prelude. Stefan ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Prelude not in haskell98?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stefan O'Rear wrote: Right, the problem is that if Prelude was in haskell98 then it wouldn't be possible to have a program that /didn't/ depend on haskell98 (short of -fno-implicit-prelude extensions, or having a Prelude in both (which would mean you couldn't depend on both base and haskell98)). There's also a pragmatic reason. Currently it is impossible to have a cycle of module imports cross package boundaries; so if the Prelude was in haskell98, then (since the Prelude depends on non-haskell98 base modules for its implementation) *Nothing* in base could use the prelude. (Assuming haskell98 depends on base currently) It seems we would want haskell98 to re-export base's Prelude. It's just that that's not implemented in released-ghc package management code. Isaac -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZfpSHgcxvIWYTTURAhPvAJwIe+CTJnOBpOLQohbK+kC8Rg2XawCeK+E0 H8vIR1fCNZE9C2/dMLXLvQw= =aMyC -END PGP SIGNATURE- ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users