Proposal: Make Semigroup and Monoid instances for Data.Functor.Compose

25 Jul
2019
25 Jul
'19
4:02 p.m.
With the Monoid 'First' and 'Last' newtypes going away, it would be nice to have equivalent Functor and Applicative instances. This works if Compose uses its components' instances: instance Semigroup (m (n a)) ⇒ Semigroup (Compose m n a) where Compose mnx <> Compose mny = Compose (mnx <> mny) instance Monoid (m (n a)) ⇒ Monoid (Compose m n a) where mempty = Compose mempty –Keith -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
2173
Age (days ago)
2173
Last active (days ago)
0 comments
1 participants
participants (1)
-
Keith