[Ported library to GHC 6.4. Nils Anders Danielsson **20050520163208 The library now compiles under both 6.2.2 and 6.4 since a bunch of preprocessor directives were added. ] { hunk ./ChasingBottoms/Approx.hs 1 -{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} +{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances -cpp #-} hunk ./ChasingBottoms/Approx.hs 105 +#if __GLASGOW_HASKELL__ <= 602 + hunk ./ChasingBottoms/Approx.hs 119 + +#else + +instance Eq DataType where + d1 == d2 = dataTypeRep d1 == dataTypeRep d2 + +#endif hunk ./ChasingBottoms/ApproxShow.hs 1 -{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} +{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances -cpp #-} hunk ./ChasingBottoms/ApproxShow.hs 125 -showCon a = showString $ conString $ toConstr a +showCon a = showString $ showConstr' a hunk ./ChasingBottoms/ApproxShow.hs 127 -isPrimitive a = maxConIndex (dataTypeOf a) == 0 +isPrimitive a = not $ isAlgType (dataTypeOf a) hunk ./ChasingBottoms/ApproxShow.hs 131 - conFixity (toConstr a) == Infix + constrFixity (toConstr a) == Infix hunk ./ChasingBottoms/ApproxShow.hs 134 + +------------------------------------------------------------------------ +-- Compatibility functions + +#if __GLASGOW_HASKELL__ <= 602 + +showConstr' a = conString $ toConstr a +isAlgType d = maxConIndex d > 0 +constrFixity = conFixity + +#else + +showConstr' a + | dataTypeRep (dataTypeOf a) == dataTypeRep (dataTypeOf 'c') = + "'" ++ showConstr (toConstr a) ++ "'" + | otherwise = showConstr $ toConstr a + +#endif hunk ./ChasingBottoms/IsType.hs 1 +{-# OPTIONS -cpp #-} + hunk ./ChasingBottoms/IsType.hs 24 -con = typerepTyCon . typeOf +con = typeRepTyCon . typeOf hunk ./ChasingBottoms/IsType.hs 32 - where s = tyconString (con x) + where s = tyConString (con x) hunk ./ChasingBottoms/IsType.hs 35 -isString x = isList x && typerepArgs (typeOf x) == typerepArgs (typeOf "") +isString x = isList x && typeRepArgs (typeOf x) == typeRepArgs (typeOf "") hunk ./ChasingBottoms/IsType.hs 39 + +------------------------------------------------------------------------ +-- Compatibility functions + +#if __GLASGOW_HASKELL__ <= 602 + +typeRepTyCon = typerepTyCon +tyConString = tyconString +typeRepArgs = typerepArgs + +#endif hunk ./ChasingBottoms/Nat.hs 1 +{-# OPTIONS -cpp #-} + hunk ./ChasingBottoms/Nat.hs 20 +#if __GLASGOW_HASKELL__ <= 602 hunk ./ChasingBottoms/Nat.hs 22 +#else +import Test.QuickCheck +#endif hunk ./ChasingBottoms/SemanticOrd.hs 1 -{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} +{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances -cpp #-} hunk ./ChasingBottoms/SemanticOrd.hs 120 - | x >? y = Just GT + | x >? y = Just Prelude.GT hunk ./ChasingBottoms/SemanticOrd.hs 185 -childrenOK op = tmapQl (&&) True op +childrenOK op = foldr (&&) True .|.. gzipWithQ op + where f .|.. g = \x y -> f (g x y) hunk ./ChasingBottoms/SemanticOrd.hs 199 - tmapT (/\??) a b + gzipWithT (/\??) a b hunk ./ChasingBottoms/SemanticOrd.hs 211 - | otherwise -> tmapM (\/??) a b + | otherwise -> gzipWithM (\/??) a b hunk ./ChasingBottoms/SemanticOrd.hs 262 + +------------------------------------------------------------------------ +-- Compatibility functions + +#if __GLASGOW_HASKELL__ <= 602 + +gzipWithT :: GenericQ GenericT -> GenericQ GenericT +gzipWithT = tmapT +gzipWithM :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m) +gzipWithM = tmapM +gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r]) +gzipWithQ q = tmapQl (++) [] (\x y -> [q x y]) + +#endif hunk ./ChasingBottoms/Tests.hs 65 --- Type annotations added just for clarity. -map_PT :: (forall t . g t -> g' t) -> F g t -> F g' t -map_PT (f :: forall t . g t -> g' t) (x :: F g t) = case x of - Left t -> Left t - Right tt -> Right ((f :: g (t, t) -> g' (t, t)) tt) +-- Pattern type signature added just for clarity. +map_PT :: (forall t . g t -> g' t) -> F g t' -> F g' t' +map_PT f x = case x of + Left t -> Left t + Right (tt :: g (t, t)) -> Right (f tt) }