Deprecate First and Last in Data.Monoid

Elliot Cameron eacameron at gmail.com
Thu Apr 12 15:15:25 UTC 2018


+1 I've been bitten by this several times. This is especially confusing
when you are using Monoid in one module and you import a different module
that happens to use the Semigroup variants, and vice versa.

On Thu, Apr 12, 2018 at 7:23 AM, Andrew Martin <andrew.thaddeus at gmail.com>
wrote:

> I agree somewhat. In the last two years, I've gotten more into the habit
> about being explicit with import lists for commonly-used modules like
> Control.Monad, Control.Applicative, and Data.Monoid. This is especially the
> case when I'm writing library code (that I expect that other people may
> read one day), although I'm more lax in application code. Still, it's nice
> to be able to fire up GHCi and do something like this without having to
> worry about conflicting identifiers:
>
>     >>> :m Data.Monoid Data.Semigroup
>
> But yes, in theory, people should avoid this. In practice, they often
> don't.
>
> On Thu, Apr 12, 2018 at 3:12 AM, Henning Thielemann <
> lemming at henning-thielemann.de> wrote:
>
>>
>> On Wed, 11 Apr 2018, Andrew Martin wrote:
>>
>> (As an aside, and the confusion I’m talking about here isn’t entirely
>>> hypothetical. I got tripped up by this when I first started using the
>>> semigroups library. I had to train myself to stop importing Data.Monoid
>>> unqualified, because it kept stealing these identifiers)
>>>
>>
>> Unqualified imports are not the problem - unqualified imports without
>> import list are the problem. People should not do that.
>
>
>
>
> --
> -Andrew Thaddeus Martin
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180412/97c5dc69/attachment.html>


More information about the Libraries mailing list