From: Ross Paterson Date: Mon, 24 Apr 2006 10:21:46 +0000 (+0000) Subject: add instances X-Git-Tag: directory_2007-05-24~307 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=88a1548deae7d2b2e1a45a9ed466cf7ffa350379;p=haskell-directory.git add instances --- diff --git a/Data/Monoid.hs b/Data/Monoid.hs index cba6993..8a30b73 100644 --- a/Data/Monoid.hs +++ b/Data/Monoid.hs @@ -111,6 +111,7 @@ instance Monoid (Endo a) where -- | Boolean monoid under conjunction. newtype All = All { getAll :: Bool } + deriving (Eq, Ord, Read, Show, Bounded) instance Monoid All where mempty = All True @@ -118,6 +119,7 @@ instance Monoid All where -- | Boolean monoid under disjunction. newtype Any = Any { getAny :: Bool } + deriving (Eq, Ord, Read, Show, Bounded) instance Monoid Any where mempty = Any False @@ -125,6 +127,7 @@ instance Monoid Any where -- | 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 @@ -132,6 +135,7 @@ instance Num a => Monoid (Sum a) where -- | 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