Add Arg{Min,Max} pattern synonyms to Data.Semigroup

Baldur Blöndal baldurpet at gmail.com
Tue Apr 18 22:07:09 UTC 2017


> This opens the door to possibly being smarter about the existing
Data.Monoid.First (and Last), encoding them as pattern synonyms for Maybe
(Data.Semigroup.First a) (or Last) as well, but we'd likely need to give
that a lot more thought / testing.

Yes First/Last is a good use for pattern synonyms

> The potential downside is using a big scary extension in what will become
a fairly mainstream module in 8.4, but I think we can phrase our way around
the issue when it comes to the libraries part of Haskell-Prime.

As for this proposal I am in no hurry to see it implemented, I figured
pattern synonyms would take time to get adopted to base. What do you mean
by "phrase our way" around the issue?

(The pattern synonyms could be added to the documentation. . "If you are
okay with PatternSynonyms..")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170418/7c51c697/attachment.html>


More information about the Libraries mailing list