Added a function to execute the CheckOptM monad on an AST

This commit is contained in:
Neil Brown 2008-11-08 16:01:08 +00:00
parent a764031068
commit 99ddca4a0f

View File

@ -185,6 +185,10 @@ onlyIfPatternMatch def f x = evaluate x >>= (\x' -> catchJust onlyPatternFail (e
onlyPatternFail (PatternMatchFail {}) = Just ()
onlyPatternFail _ = Nothing
runChecks :: CheckOptM () -> A.AST -> PassM A.AST
runChecks (CheckOptM m) x = execStateT m (CheckOptData {ast = x, parItems = Nothing})
>>* ast
--getParItems :: CheckOptM (ParItems ())
--getParItems = CheckOptM (\d -> Right (d, fromMaybe (generateParItems $ ast d) (parItems d)))