ekmett / profunctors

Haskell 98 Profunctors
http://hackage.haskell.org/package/profunctors
Other
70 stars 43 forks source link

Add Monoid/Semigroup for Forget #95

Closed ChrisPenner closed 3 years ago

ChrisPenner commented 3 years ago

This hopefully isn't too controversial since this is the natural Monoid for the underlying function; in fact you could deriving via (a -> r) if you wanted.

Adding this allows us to smash together Folds with profunctor optics; e.g. you get (x ^.. to f <> to g) == [f x, g x] which is nice, and this instance just generally does the Right Thingโ„ข when working with Forget ๐Ÿ˜„

Let me know if there's anything else you need ๐Ÿ‘

Thanks for maintaining this library; it's taught me a lot over the years!

ChrisPenner commented 3 years ago

Sounds good; I've addressed everything ๐Ÿ‘