[added Data.Monoid.Ord to correct for the lack of Priority, Min, and Max monoids
ekmett@gmail.com**20090323043643] {
addfile ./Data/Monoid/Ord.hs
hunk ./Data/Monoid/Ord.hs 1
+module Data.Monoid.Ord
+ ( module Data.Monoid
+ , Min(Min,getMin)
+ , Max(Max,getMax)
+ , Priority(Priority,getPriority)
+ ) where
+
+import Data.Monoid (Monoid, mappend, mempty)
+
+newtype Min a = Min { getMin :: a } deriving (Eq,Ord,Show,Read,Bounded)
+
+instance (Ord a, Bounded a) => Monoid (Min a) where
+ mempty = Min maxBound
+ Min a `mappend` Min b = Min (a `min` b)
+
+newtype Max a = Max { getMax :: a } deriving (Eq,Ord,Show,Read,Bounded)
+
+instance (Ord a, Bounded a) => Monoid (Max a) where
+ mempty = Max minBound
+ Max a `mappend` Max b = Max (a `max` b)
+
+newtype Priority a = Priority { getPriority :: Maybe a } deriving (Eq,Ord,Show,Read)
+
+instance (Ord a) => Monoid (Priority a) where
+ mempty = Priority Nothing
+ Priority a `mappend` Priority b = Priority (a `max` b)
addfile ./dist/doc/html/lexical-monoids/Data-Monoid-Ord.html
hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Ord.html 1
+
+
+