diff --git a/backends/TLP.hs b/backends/TLP.hs index e4effd2..7dd6179 100644 --- a/backends/TLP.hs +++ b/backends/TLP.hs @@ -35,9 +35,9 @@ data TLPChannel = TLPIn | TLPOut | TLPError -- | Get the name of the TLP and the channels it uses. -- Fail if the process isn't using a valid interface. -tlpInterface :: (CSM m, Die m) => m ( A.Name, [(A.Direction, TLPChannel)] ) +tlpInterface :: (CSMR m, Die m) => m ( A.Name, [(A.Direction, TLPChannel)] ) tlpInterface - = do ps <- get + = do ps <- getCompState when (null $ csMainLocals ps) (dieReport (Nothing,"No main process found")) let mainName = snd $ head $ csMainLocals ps st <- specTypeOfName mainName @@ -48,7 +48,7 @@ tlpInterface when ((nub (map snd chans)) /= (map snd chans)) $ dieP (findMeta mainName) "Channels used more than once in TLP" return (mainName, chans) where - tlpChannel :: (CSM m, Die m) => Meta -> A.Formal -> m (A.Direction, TLPChannel) + tlpChannel :: (CSMR m, Die m) => Meta -> A.Formal -> m (A.Direction, TLPChannel) tlpChannel m (A.Formal _ (A.Chan dir _ _) n) = do def <- lookupName n let origN = A.ndOrigName def diff --git a/common/PrettyShow.hs b/common/PrettyShow.hs index 14a4201..ec9f5b5 100644 --- a/common/PrettyShow.hs +++ b/common/PrettyShow.hs @@ -38,7 +38,7 @@ import qualified Data.Set as Set import Text.PrettyPrint.HughesPJ import qualified AST as A -import CompState +import CompState hiding (CSM) -- everything here is read-only import Metadata import Pattern import ShowCode @@ -153,8 +153,8 @@ doAny extFunc = extFunc ( pshow :: Data a => a -> String pshow x = render $ doAny id x -pshowCode :: (Data a, CSM m) => a -> m String -pshowCode c = do st <- get +pshowCode :: (Data a, CSMR m) => a -> m String +pshowCode c = do st <- getCompState case csFrontend st of FrontendOccam -> return $ render $ (extOccam $ doAny extOccam) c FrontendRain -> return $ render $ (extRain $ doAny extRain) c