[Haskell-cafe] Feature Proposal: GHC Flag for implicit external Prelude

Alois Cochard alois.cochard at gmail.com
Tue Jul 15 17:34:48 UTC 2014


+1

I was actually looking for a feature like that few days ago!
On Jul 15, 2014 4:24 AM, "Andrew Gibiansky" <andrew.gibiansky at gmail.com>
wrote:

> Hey all,
>
> 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
>
> import MyNewPrelude
>
> 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
> current Prelude.
>
> 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:
>
> 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
> the file.
>
> 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?
>
> -- Andrew
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140715/9ba8b7c2/attachment.html>


More information about the Haskell-Cafe mailing list