2 ms·
Likely meant to be lifting instances of Semigroup and Monoid through Dual: newtype Dual a = Dual {getDual :: a} instance Semigroup s => Semigroup (Dua
by tczMUFlmoNk 4y ago
Likely meant to be lifting instances of Semigroup and Monoid through Dual:
newtype Dual a = Dual {getDual :: a}
instance Semigroup s => Semigroup (Dual s) where
(Dual a) <> (Dual b) = Dual (b <> a)
instance Monoid m => Monoid (Dual m) where
mempty = Dual (mempty)