1
0
forked from GitHub/gf-core

started grammar checking with new internal format

This commit is contained in:
aarne
2007-12-06 15:50:54 +00:00
parent f08eb82f2b
commit bfd215aa7f
4 changed files with 69 additions and 54 deletions

View File

@@ -92,11 +92,13 @@ termOpGF f g = do
fm = termOpModule f
termOpModule :: Monad m => (Term -> m Term) -> Module -> m Module
termOpModule f m = do
mjs <- mapMapM fj (mjments m)
termOpModule f = judgementOpModule fj where
fj = either (liftM Left . termOpJudgement f) (return . Right)
judgementOpModule :: Monad m => (Judgement -> m Judgement) -> Module -> m Module
judgementOpModule f m = do
mjs <- mapMapM f (mjments m)
return m {mjments = mjs}
where
fj = either (liftM Left . termOpJudgement f) (return . Right)
termOpJudgement :: Monad m => (Term -> m Term) -> Judgement -> m Judgement
termOpJudgement f j = do