-- | Boolean monoid under conjunction.
newtype All = All { getAll :: Bool }
+ deriving (Eq, Ord, Read, Show, Bounded)
instance Monoid All where
mempty = All True
-- | Boolean monoid under disjunction.
newtype Any = Any { getAny :: Bool }
+ deriving (Eq, Ord, Read, Show, Bounded)
instance Monoid Any where
mempty = Any False
-- | Monoid under addition.
newtype Sum a = Sum { getSum :: a }
+ deriving (Eq, Ord, Read, Show, Bounded)
instance Num a => Monoid (Sum a) where
mempty = Sum 0
-- | Monoid under multiplication.
newtype Product a = Product { getProduct :: a }
+ deriving (Eq, Ord, Read, Show, Bounded)
instance Num a => Monoid (Product a) where
mempty = Product 1