
At Fri, 17 Jun 2011 14:47:30 +0000, Simon Peyton-Jones wrote:
(Plan A) Add a module 'Prelude' to package 'haskell98'. ... (Plan B) Like Plan A, but in addition, if you say "{-# LANGUAGE Haskell98 #-}" in the file, or -XHaskell98 on the command line, the implicit import of Prelude comes from package 'haskell98', provided -package haskell98 is specified, but regardless of what other in-scope packages expose a Prelude module.
This is probably too much to ask, but if you were to do something like plan B, is there any possibility of generalizing the mechanism? For instance, suppose the -package flag took a colon-separated list of packages, like " ... -package haskell98:base -package mtl ...". The meaning would be to include both haskell98 and base, but, unlike "-package haskell98 -package base," to accept ambiguous module names within a single -package argument and resolve them to the first matching package in the list. Something like this could be useful for SafeHaskell, where, for compatibility, one might want to create safe "overlay" packages. (And of course, the GHC PackageImports extension would still be there for cases where people need to do weird things.) David