Changed the passes to be of type Pass, rather than A.Process -> PassM A.Process
This commit is contained in:
parent
30b7cc686b
commit
a25824b601
|
@ -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
|
||||
|
|
|
@ -29,7 +29,7 @@ import Metadata
|
|||
import Types
|
||||
import Pass
|
||||
|
||||
simplifyComms :: A.Process -> PassM A.Process
|
||||
simplifyComms :: Pass
|
||||
simplifyComms = runPasses passes
|
||||
where
|
||||
passes =
|
||||
|
|
|
@ -30,7 +30,7 @@ import Metadata
|
|||
import Pass
|
||||
import Types
|
||||
|
||||
simplifyExprs :: A.Process -> PassM A.Process
|
||||
simplifyExprs :: Pass
|
||||
simplifyExprs = runPasses passes
|
||||
where
|
||||
passes =
|
||||
|
|
|
@ -28,7 +28,7 @@ import Metadata
|
|||
import Types
|
||||
import Pass
|
||||
|
||||
simplifyProcs :: A.Process -> PassM A.Process
|
||||
simplifyProcs :: Pass
|
||||
simplifyProcs = runPasses passes
|
||||
where
|
||||
passes =
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import Metadata
|
|||
import Pass
|
||||
import Types
|
||||
|
||||
unnest :: A.Process -> PassM A.Process
|
||||
unnest :: Pass
|
||||
unnest = runPasses passes
|
||||
where
|
||||
passes =
|
||||
|
|
Loading…
Reference in New Issue
Block a user