From bfd215aa7f79c97a5488349dc372f473950ea38d Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 6 Dec 2007 15:50:54 +0000 Subject: started grammar checking with new internal format --- src/GF/Devel/Grammar/Macros.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/GF/Devel/Grammar') diff --git a/src/GF/Devel/Grammar/Macros.hs b/src/GF/Devel/Grammar/Macros.hs index 785b69902..1b4ed1448 100644 --- a/src/GF/Devel/Grammar/Macros.hs +++ b/src/GF/Devel/Grammar/Macros.hs @@ -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 -- cgit v1.2.3