Proposal: add `on` to the Prelude

Evan Laforge qdunkan at gmail.com
Wed Sep 11 16:20:24 UTC 2019


On Wed, Sep 11, 2019 at 7:11 AM Ivan Lazar Miljenovic
<ivan.miljenovic at gmail.com> wrote:
>
> -1 from me; I have no problem with long import lists as I'd prefer to know _where_ a function comes from than keeping track of "what's in Prelude this month?" (looking at you random Monoid, Semigroup, etc. additions to Prelude).
>
> I use `on` a _lot_ and have never once considered doing a custom Prelude or anything like that.

I solved the "not in prelude" problem for myself long ago by writing a
tool to manage imports.  So I either use a local "prelude addition"
module, or I configure the tool with the set of things I'd like to be
in scope unqualified and it makes sure they're imported if they're
used.  Not that I expect everyone to use such a tool, but just that
there are a few ways to solve the problem.

When the Prelude changes it becomes especially easy to break
compatibility with a previous ghc version.  Even if you have CI
running with previous ghcs, the notification is very late.  I suppose
hlint could probably be configured to warn in advance though.

To this day I still have lots of "unused import" warnings due to (<>)
that I can't get rid of without either tons of CPP or dropping
compatibility for whatever version it was that put it in prelude
(though I think Monoid was worth it!).


More information about the Libraries mailing list