From 2ed1c4152dd1cc8e292ae64f0c4b33b11354a53b Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 21 Jul 2016 17:17:35 -0400 Subject: [PATCH] Derive some Typeable instances. --- src/Category.hs | 2 +- src/Data/Record.hs | 1 + src/Info.hs | 2 +- src/Range.hs | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Category.hs b/src/Category.hs index 5dd35d817..26aceea4a 100644 --- a/src/Category.hs +++ b/src/Category.hs @@ -30,7 +30,7 @@ data Category | ArrayLiteral -- | A non-standard category, which can be used for comparability. | Other String - deriving (Eq, Generic, Ord, Show) + deriving (Eq, Generic, Ord, Show, Typeable) -- Instances diff --git a/src/Data/Record.hs b/src/Data/Record.hs index 70646facc..c5c2ce65a 100644 --- a/src/Data/Record.hs +++ b/src/Data/Record.hs @@ -11,6 +11,7 @@ import Test.QuickCheck data Record :: [*] -> * where RNil :: Record '[] RCons :: h -> Record t -> Record (h ': t) + deriving Typeable infixr 0 .: diff --git a/src/Info.hs b/src/Info.hs index 5c7b8223d..309944bf4 100644 --- a/src/Info.hs +++ b/src/Info.hs @@ -8,7 +8,7 @@ import Range import Test.QuickCheck newtype Cost = Cost { unCost :: Integer } - deriving (Eq, Num, Ord, Show) + deriving (Eq, Num, Ord, Show, Typeable) characterRange :: HasField fields Range => Record fields -> Range characterRange = getField diff --git a/src/Range.hs b/src/Range.hs index 4479253b4..504357edc 100644 --- a/src/Range.hs +++ b/src/Range.hs @@ -9,7 +9,7 @@ import Test.QuickCheck -- | A half-open interval of integers, defined by start & end indices. data Range = Range { start :: !Int, end :: !Int } - deriving (Eq, Show) + deriving (Eq, Show, Typeable) -- | Make a range at a given index. rangeAt :: Int -> Range