Eta-expand some higher-rank functions. GHC is about to
move to *invariant* rather than *contra-variant* in function
arguments, so far as type subsumption is concerned. These
eta-expansions are simple, and allow type inference to
go through with invariance.
2 -> k (k (z (:)))
_ -> error "gunfold"
dataTypeOf _ = listDataType
2 -> k (k (z (:)))
_ -> error "gunfold"
dataTypeOf _ = listDataType
--
-- The gmaps are given as an illustration.
--
-- The gmaps are given as an illustration.
2 -> k (z Just)
_ -> error "gunfold"
dataTypeOf _ = maybeDataType
2 -> k (z Just)
_ -> error "gunfold"
dataTypeOf _ = maybeDataType
------------------------------------------------------------------------------
------------------------------------------------------------------------------
2 -> k (z Right)
_ -> error "gunfold"
dataTypeOf _ = eitherDataType
2 -> k (z Right)
_ -> error "gunfold"
dataTypeOf _ = eitherDataType
------------------------------------------------------------------------------
------------------------------------------------------------------------------
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Prelude.(->)"
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Prelude.(->)"
------------------------------------------------------------------------------
------------------------------------------------------------------------------
gunfold k z c | constrIndex c == 1 = k (k (z (,)))
gunfold _ _ _ = error "gunfold"
dataTypeOf _ = tuple2DataType
gunfold k z c | constrIndex c == 1 = k (k (z (,)))
gunfold _ _ _ = error "gunfold"
dataTypeOf _ = tuple2DataType
------------------------------------------------------------------------------
------------------------------------------------------------------------------
- geq' :: forall a b. (Data a, Data b) => a -> b -> Bool
+ geq' :: GenericQ (GenericQ Bool)
geq' x y = (toConstr x == toConstr y)
&& and (gzipWithQ geq' x y)
-- | Generic zip controlled by a function with type-specific branches
geq' x y = (toConstr x == toConstr y)
&& and (gzipWithQ geq' x y)
-- | Generic zip controlled by a function with type-specific branches
-gzip :: (forall a b. (Data a, Data b) => a -> b -> Maybe b)
- -> (forall a b. (Data a, Data b) => a -> b -> Maybe b)
-
+gzip :: GenericQ (GenericM Maybe) -> GenericQ (GenericM Maybe)
-- See testsuite/.../Generics/gzip.hs for an illustration
gzip f x y =
f x y
-- See testsuite/.../Generics/gzip.hs for an illustration
gzip f x y =
f x y
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Data.IntMap.IntMap"
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Data.IntMap.IntMap"
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Data.Map.Map"
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Data.Map.Map"
dataTypeOf _ = seqDataType
dataTypeOf _ = seqDataType
emptyConstr = mkConstr seqDataType "empty" [] Prefix
consConstr = mkConstr seqDataType "<|" [] Infix
emptyConstr = mkConstr seqDataType "empty" [] Prefix
consConstr = mkConstr seqDataType "<|" [] Infix
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Data.Set.Set"
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNorepType "Data.Set.Set"