From 88a1548deae7d2b2e1a45a9ed466cf7ffa350379 Mon Sep 17 00:00:00 2001 From: Ross Paterson Date: Mon, 24 Apr 2006 10:21:46 +0000 Subject: [PATCH] add instances --- Data/Monoid.hs | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 1.7.10.4