diff --git a/common/Pass.hs b/common/Pass.hs index 204f3f6..e5bc0db 100644 --- a/common/Pass.hs +++ b/common/Pass.hs @@ -112,7 +112,7 @@ makeGeneric top `extM` (return :: String -> PassM String) `extM` (return :: Meta -> PassM Meta) -excludeConstr :: Data a => [Constr] -> a -> PassM a +excludeConstr :: (Data a, CSMR m) => [Constr] -> a -> m a 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) where diff --git a/frontends/RainPasses.hs b/frontends/RainPasses.hs index 2631465..bc58691 100644 --- a/frontends/RainPasses.hs +++ b/frontends/RainPasses.hs @@ -283,7 +283,7 @@ pullUpParDeclarations = everywhereM (mkM pullUpParDeclarations') chaseSpecs _ = Nothing -- | 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 [ con0 A.Int ,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). -excludeNonRainFeatures :: Data t => t -> PassM t +excludeNonRainFeatures :: (Data t, CSMR m) => t -> m t excludeNonRainFeatures = excludeConstr [ con0 A.Real32 ,con0 A.Real64