<div dir="ltr">Hey all,<div><br></div><div>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. </div>

<div><br></div><div>This would have an effect similar to -XNoImplicitPrelude and an additional</div><div><br></div><div><font face="courier new, monospace">import MyNewPrelude</font></div><div><br></div><div>in the source file. It might be a <i>little</i> different semantically, as a qualified import would disable the original implicit import, just like it does with the default Haskell prelude. </div>

<div><br></div><div>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 current Prelude. </div>

<div><br></div><div>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 this:</div><div><br></div><div>ghc --with-prelude=MyNewPrelude Main.hs</div>

<div><br></div><div>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 the file.</div><div><br></div><div>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 <i>bad</i> idea).</div>

<div><br></div><div>What are your thoughts on this proposal?</div><div><br></div><div>-- Andrew</div></div>