Commits

Iago Abal committed 3482374

Fix: Since GHC 7.8 Typeable instances must be derived

See https://ghc.haskell.org/trac/ghc/wiki/GhcKinds/PolyTypeable

Comments (0)

Files changed (1)

Data/BitVector.hs

 {-# OPTIONS_GHC -funbox-strict-fields #-}
 
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE DeriveDataTypeable #-}
 
 -- |
 -- Module    : Data.BitVector
       size :: !Int      -- ^ The /size/ of a bit-vector.
     , nat  :: !Integer  -- ^ The value of a bit-vector, as a natural number.
     }
+  deriving (Data,Typeable)
 
 -- | An alias for 'BV'.
 type BitVector = BV
 instance Show BV where
   show (BV n a) = "[" ++ show n ++ "]" ++ show a
 
-instance Typeable BV where
-  typeOf _ = mkTyConApp bvTyCon []
-    where bvTyCon = mkTyCon3 "bv" "Data.BitVector" "BV"
-
-instance Data BV where
-  gfoldl k r (BV x1 x2) = r BV `k` x1 `k` x2
-  gunfold k z c
-    = case constrIndex c - 1 of
-          0 -> k $ k $ z BV
-          i -> error $ "Data.gunfold for BV, unknown index: " ++ show i
-  toConstr x@BV{} = indexConstr (dataTypeOf x) 1
-  dataTypeOf _ = ty
-    where ty = mkDataType "Data.BitVector.BV"
-                  [mkConstr ty "BV" ["size", "nat"] Prefix]
-
 ----------------------------------------------------------------------
 --- Construction