Commits

Bryan O'Sullivan committed 175650a

More Typeable and Data instances.

Comments (0)

Files changed (2)

Criterion/Config.hs

     ) where
 
 import Criterion.MultiMap (MultiMap)
+import Data.Data (Data)
 import Data.Function (on)
 import Data.Monoid (Monoid(..), Last(..))
 import Data.Typeable (Typeable)
                | List           -- ^ Print a list of known benchmarks.
                | Version        -- ^ Print version information (if known).
                | Help           -- ^ Print a help\/usaage message.
-                 deriving (Eq, Ord, Bounded, Enum, Read, Show, Typeable)
+                 deriving (Eq, Ord, Bounded, Enum, Read, Show, Typeable, Data)
 
 instance Monoid PrintExit where
     mempty  = Nada
                 | PNG Int Int   -- ^ PNG file, dimensions in pixels.
                 | SVG Int Int   -- ^ SVG file, dimensions in points.
                 | Window Int Int-- ^ Display in a window, dimensions in pixels.
-                  deriving (Eq, Ord, Read, Show, Typeable)
+                  deriving (Eq, Ord, Read, Show, Typeable, Data)
 
 -- | What to plot.
 data Plot = KernelDensity       -- ^ Kernel density estimate of probabilities.
           | Timing              -- ^ Benchmark timings.
-            deriving (Eq, Ord, Read, Show, Typeable)
+            deriving (Eq, Ord, Read, Show, Typeable, Data)
 
 -- | Top-level program configuration.
 data Config = Config {

Criterion/MultiMap.hs

+{-# LANGUAGE DeriveDataTypeable #-}
+
 module Criterion.MultiMap
     (
       MultiMap
     , lookup
     ) where
 
+import Data.Data (Data)
 import Data.Monoid (Monoid(..))
+import Data.Typeable (Typeable)
 import Prelude hiding (lookup)
 import qualified Data.Map as M
 import qualified Data.Set as S
 newtype MultiMap k v = MultiMap {
       toMap :: M.Map k (S.Set v)
     }
-    deriving (Eq, Ord, Read, Show)
+    deriving (Eq, Ord, Read, Show, Typeable, Data)
 
 instance (Ord k, Ord v) => Monoid (MultiMap k v) where
     mempty = MultiMap M.empty