Added a function to execute the CheckOptM monad on an AST
This commit is contained in:
parent
a764031068
commit
99ddca4a0f
|
@ -185,6 +185,10 @@ onlyIfPatternMatch def f x = evaluate x >>= (\x' -> catchJust onlyPatternFail (e
|
||||||
onlyPatternFail (PatternMatchFail {}) = Just ()
|
onlyPatternFail (PatternMatchFail {}) = Just ()
|
||||||
onlyPatternFail _ = Nothing
|
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 (ParItems ())
|
||||||
--getParItems = CheckOptM (\d -> Right (d, fromMaybe (generateParItems $ ast d) (parItems d)))
|
--getParItems = CheckOptM (\d -> Right (d, fromMaybe (generateParItems $ ast d) (parItems d)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user