Stop the deprecation of Data.Monoid.{First,Last}

chessai . chessai1996 at gmail.com
Sat Apr 11 05:27:47 UTC 2020


Simon,

Great and thorough explanation!

Indeed the CLC was not sufficiently thorough here. I'm really sorry to
anyone this deprecation notice has negatively impacted (Conal and Sandy,
probably others). I should have been more vocal in the past about my
thoughts that this was a bad idea. Since then, even more has been
discovered which shows this to not be good overall. Again, I'm very sorry
to anyone the deprecation notice may have negatively affected, and we will
work harder to make sure things like this happen with as little frequency
as possible.

Also, FWIW, I'm in favour of (C), do nothing but correct the documentation,
because I actually do use D.S.{First,Last} relatively often, especially
with Foldable1. As I mentioned on the GHC Trac, I use both of these
qualified.

Thanks Simon for all of your work and all of your sleuthing.


On Fri, Apr 10, 2020, 8:30 PM Simon Jakobi via Libraries <
libraries at haskell.org> wrote:

> Hi!
>
> For two years there has been a plan ([1], [12]) to deprecate and
> eventually remove Data.Monoid.{First,Last} ([13]), in order to resolve
> the name conflict with Data.Semigroup.{First,Last} ([14]).
>
> While implementing ([2]) this plan in GHC and the core libraries, and
> testing the migration in a few packages, I encountered some
> difficulties which made me question whether the benefits of the
> deprecation would outweigh its costs:
>
> * Code that previously used Data.Monoid.{First,Last} becomes noisier.
> See e.g. a patch to migrate the summoner package ([3]).
>
> * Higher Kinded Data applications of D.M.{First,Last} such as in
> higgledy ([4]) are difficult to migrate, partly due to missing
> instances for D.S.{First,Last} ([5]).
>
> * Additionally, there's an important difference in the strictness of
> the Semigroup instances for D.M.{First.Last} and the suggested
> replacement of (Maybe D.S.{First,Last}): [6], [9].
>
> In sum, the existing migration story is painful in multiple ways.
>
> Moreover, D.S.{First,Last} don't actually seem to be useful in
> practice. I couldn't find any code using them except to define the
> usual newtype instances.
>
> In consequence, I think the deprecation should be scrapped, and the
> documentation of base updated accordingly.
>
> Regarding alternative ways to resolve the name clash, I see the
> following options:
>
> A) Deprecate and remove D.S.{First,Last}.
> B) Rename D.S.{First,Last}.
> C) Do nothing. Haskellers are already used to handling the name clash,
> usually via qualified imports.
>
> I would also like to mention that the process surrounding the
> deprecation has IMHO been somewhat less than ideal:
>
> 1. The deprecation was apparently decided without much research on how
> D.M.{First,Last} are being used in the ecosystem, and without properly
> testing the suggested migration.
>
> 2. Apart from the brief discussion on the libraries mailing list and
> changes to the haddocks ([7], [8]) for D.M.{First,Last}, there appears
> not to have been any announcement of the planned deprecation.
>
> 3. When, shortly after the haddocks changes, the strictness
> differences between D.M.First and (Maybe D.S.First) were pointed out
> on the libraries mailing list ([9]), the deprecation was apparently
> not reconsidered, nor the documentation updated. I myself wasn't aware
> of this aspect while I worked on the deprecation!
>
> 4. I should have sent this email 9 months ago, when I stopped working
> on the deprecation. The incorrect information in the haddocks has
> since caused some confusion ([10], [11]).
>
> What do you think?
>
> Cheers,
> Simon
>
> [1] https://mail.haskell.org/pipermail/libraries/2018-April/028712.html
> [2] https://gitlab.haskell.org/ghc/ghc/-/merge_requests/842
> [3] https://github.com/kowainik/summoner/pull/319
> [4] https://github.com/i-am-tom/higgledy/issues/4
> [5] https://gitlab.haskell.org/ghc/ghc/issues/16636
> [6] https://gitlab.haskell.org/ghc/ghc/issues/17967
> [7]
> https://gitlab.haskell.org/ghc/ghc/-/commit/e34e30e492a7bc40e3da5a05b8e297acb0aeeadc
> [8]
> https://gitlab.haskell.org/ghc/ghc/-/commit/cf35ab9ac7e0f33e39af6af16ecf850e24c2cb79
> [9] https://mail.haskell.org/pipermail/libraries/2018-May/028818.html
> [10] https://github.com/conal/checkers/issues/44
> [11] https://gitlab.haskell.org/ghc/ghc/issues/18041
> [12] https://gitlab.haskell.org/ghc/ghc/issues/15028
> [13]
> http://downloads.haskell.org/~ghc/8.10.1/docs/html/libraries/base-4.14.0.0/Data-Monoid.html#t:First
> [14]
> http://downloads.haskell.org/~ghc/8.10.1/docs/html/libraries/base-4.14.0.0/Data-Semigroup.html#t:First
> _______________________________________________
> 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/20200410/ad5034b0/attachment.html>


More information about the Libraries mailing list