projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d649fe
)
add derived instances for Dual monoid
author
Ross Paterson
<ross@soi.city.ac.uk>
Fri, 2 Feb 2007 19:08:47 +0000
(19:08 +0000)
committer
Ross Paterson
<ross@soi.city.ac.uk>
Fri, 2 Feb 2007 19:08:47 +0000
(19:08 +0000)
Data/Monoid.hs
patch
|
blob
|
history
diff --git
a/Data/Monoid.hs
b/Data/Monoid.hs
index
8a30b73
..
c51c4ca
100644
(file)
--- a/
Data/Monoid.hs
+++ b/
Data/Monoid.hs
@@
-97,6
+97,7
@@
instance Monoid Ordering where
-- | The dual of a monoid, obtained by swapping the arguments of 'mappend'.
newtype Dual a = Dual { getDual :: a }
-- | The dual of a monoid, obtained by swapping the arguments of 'mappend'.
newtype Dual a = Dual { getDual :: a }
+ deriving (Eq, Ord, Read, Show, Bounded)
instance Monoid a => Monoid (Dual a) where
mempty = Dual mempty
instance Monoid a => Monoid (Dual a) where
mempty = Dual mempty