mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Derive some Typeable instances.
This commit is contained in:
parent
864e8a4539
commit
2ed1c4152d
@ -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
|
||||
|
@ -11,6 +11,7 @@ import Test.QuickCheck
|
||||
data Record :: [*] -> * where
|
||||
RNil :: Record '[]
|
||||
RCons :: h -> Record t -> Record (h ': t)
|
||||
deriving Typeable
|
||||
|
||||
infixr 0 .:
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user