ekmett / reducers

Semigroups, specialized containers and a general map/reduce framework
http://hackage.haskell.org/package/reducers
Other
46 stars 11 forks source link

`Mon` is `Ap`? #28

Open georgefst opened 2 years ago

georgefst commented 2 years ago

Isn't Data.Semigroup.Monad.Mon identical to base's Data.Monoid.Ap?

Either way, it would be worth a haddock comment clarifying the relationship, and why Mon exists (just for backwards compatiblity?).

RyanGlScott commented 2 years ago

Yes, good observation. Mon is pretty ancient, dating back to 9b4450560018e6d2e876a6184737fa5a320998cd (before the ApplicativeMonad proposal, IIRC). Now that Applicative is a superclass of Monad, there's not much reason to use Mon over Ap. I'd be happy to deprecate the former in favor of the latter.

Speaking of which, reducers has its own cargo-culted version of Ap here. Perhaps we should use the version from base on sufficiently recent versions of GHC.