[Haskell-cafe] Feature Proposal: GHC Flag for implicit external Prelude
andrew.gibiansky at gmail.com
Tue Jul 15 03:23:21 UTC 2014
I would like to propose a very minor flag to add to GHC. I would like GHC
to have a --with-prelude flag, which would specify an alternate Prelude to
use instead of the default Haskell prelude.
This would have an effect similar to -XNoImplicitPrelude and an additional
in the source file. It might be a *little* different semantically, as a
qualified import would disable the original implicit import, just like it
does with the default Haskell prelude.
The benefit this would have is that this would give alternate preludes a
more first-class status. Instead of having to import an alternative prelude
everywhere, you could just have a ghc-options: --with-prelude=... flag in
your *.cabal file, and have a different prelude be used. This is important
for my own work, as I highly prefer other preludes for my non-library
development; I think this is a feature which will be very useful as Haskell
develops and we try to figure out how to get rid of the warts in the
In order to specify the actula module, I propose that you just pass the
module name as the --with-prelude argument. You could thus invoke GHC like
ghc --with-prelude=MyNewPrelude Main.hs
Then, the same rules apply for figuring out which MyNewPrelude module you
are referring to as if you had written a `import MyNewPrelude` statement in
I am willing to implement this for GHC if people agree that this is a
useful flag (or at least agree that isn't not a *bad* idea).
What are your thoughts on this proposal?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe