Generalised the type of the monad for the excludeConstr function, and correspondingly the functions that use it

This commit is contained in:
Neil Brown 2008-02-08 11:33:19 +00:00
parent 035c526bef
commit 95cdb39789
2 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ makeGeneric top
`extM` (return :: String -> PassM String) `extM` (return :: String -> PassM String)
`extM` (return :: Meta -> PassM Meta) `extM` (return :: Meta -> PassM Meta)
excludeConstr :: Data a => [Constr] -> a -> PassM a excludeConstr :: (Data a, CSMR m) => [Constr] -> a -> m a
excludeConstr cons x excludeConstr cons x
= if null items then return x else dieInternal (Nothing, "Excluded item still remains in source tree: " ++ (show $ head items) ++ " tree is: " ++ pshow x) = if null items then return x else dieInternal (Nothing, "Excluded item still remains in source tree: " ++ (show $ head items) ++ " tree is: " ++ pshow x)
where where

View File

@ -283,7 +283,7 @@ pullUpParDeclarations = everywhereM (mkM pullUpParDeclarations')
chaseSpecs _ = Nothing chaseSpecs _ = Nothing
-- | All the items that should have been removed at the end of the Rain passes. -- | All the items that should have been removed at the end of the Rain passes.
excludeTransformedRainFeatures :: Data t => t -> PassM t excludeTransformedRainFeatures :: (Data t, CSMR m) => t -> m t
excludeTransformedRainFeatures = excludeConstr excludeTransformedRainFeatures = excludeConstr
[ con0 A.Int [ con0 A.Int
,con0 A.Any ,con0 A.Any
@ -292,7 +292,7 @@ excludeTransformedRainFeatures = excludeConstr
] ]
-- | All the items that should not occur in an AST that comes from Rain (up until it goes into the shared passes). -- | All the items that should not occur in an AST that comes from Rain (up until it goes into the shared passes).
excludeNonRainFeatures :: Data t => t -> PassM t excludeNonRainFeatures :: (Data t, CSMR m) => t -> m t
excludeNonRainFeatures = excludeConstr excludeNonRainFeatures = excludeConstr
[ con0 A.Real32 [ con0 A.Real32
,con0 A.Real64 ,con0 A.Real64