Changed the passes to be of type Pass, rather than A.Process -> PassM A.Process

This commit is contained in:
Neil Brown 2007-10-17 13:09:16 +00:00
parent 30b7cc686b
commit a25824b601
6 changed files with 9 additions and 13 deletions

View File

@ -42,7 +42,7 @@ instance Die PassM where
type Pass = A.Process -> PassM A.Process
-- | Compose a list of passes into a single pass.
runPasses :: [(String, Pass)] -> A.Process -> PassM A.Process
runPasses :: [(String, Pass)] -> Pass
runPasses [] ast = return ast
runPasses ((s, p):ps) ast
= do debug $ "{{{ " ++ s
@ -83,7 +83,7 @@ veryDebug :: (CSM m, MonadIO m) => String -> m ()
veryDebug = verboseMessage 3
-- | Dump the AST and parse state.
debugAST :: (CSM m, MonadIO m) => A.Process -> m ()
debugAST :: (CSM m, MonadIO m, Data t) => t -> m ()
debugAST p
= do veryDebug $ "{{{ AST"
veryDebug $ pshow p

View File

@ -29,7 +29,7 @@ import Metadata
import Types
import Pass
simplifyComms :: A.Process -> PassM A.Process
simplifyComms :: Pass
simplifyComms = runPasses passes
where
passes =

View File

@ -30,7 +30,7 @@ import Metadata
import Pass
import Types
simplifyExprs :: A.Process -> PassM A.Process
simplifyExprs :: Pass
simplifyExprs = runPasses passes
where
passes =

View File

@ -28,7 +28,7 @@ import Metadata
import Types
import Pass
simplifyProcs :: A.Process -> PassM A.Process
simplifyProcs :: Pass
simplifyProcs = runPasses passes
where
passes =

View File

@ -26,7 +26,7 @@ import qualified AST as A
import Pass
import Types
simplifyTypes :: A.Process -> PassM A.Process
simplifyTypes :: Pass
simplifyTypes = runPasses passes
where
passes =
@ -46,10 +46,6 @@ resolveNamedTypes = doGeneric `extM` doType
doType t = doGeneric t
-- | Resolve named types in CompState.
rntState :: A.Process -> PassM A.Process
rntState p
= do st <- get
st' <- resolveNamedTypes st
put st'
return p
rntState :: Data t => t -> PassM t
rntState p = (get >>= resolveNamedTypes >>= put) >> return p

View File

@ -32,7 +32,7 @@ import Metadata
import Pass
import Types
unnest :: A.Process -> PassM A.Process
unnest :: Pass
unnest = runPasses passes
where
passes =