
15 Feb
2019
15 Feb
'19
7:04 p.m.
Thoughts on adding a newtype with the following Alternative instance? (The name chosen is a placeholder, I don't have any particular preference). newtype Mon f a = Mon { unMon :: f a } instance (forall a. Monoid (f a)) => Alternative (Mon f) where empty = Mon mempty (<|>) (Mon m1) (Mon m2) = Mon (m1 <> m2)