From d64419f2f25f0fb5a28bddf198dce6ac26b75296 Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 2 Oct 2009 22:52:14 +0000 Subject: refactor GF.Infra.CheckM and use the CheckM monad in the renamer as well --- src/GF/Grammar/API.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/GF/Grammar/API.hs') diff --git a/src/GF/Grammar/API.hs b/src/GF/Grammar/API.hs index f1d70e470..8dc86c10e 100644 --- a/src/GF/Grammar/API.hs +++ b/src/GF/Grammar/API.hs @@ -8,6 +8,7 @@ module GF.Grammar.API ( ) where import GF.Infra.Ident +import GF.Infra.CheckM import GF.Infra.Modules (greatestResource) import GF.Compile.GetGrammar import GF.Grammar.Macros @@ -16,7 +17,7 @@ import GF.Grammar.Printer import GF.Grammar.Grammar import GF.Compile.Rename (renameSourceTerm) -import GF.Compile.CheckGrammar (justCheckLTerm) +import GF.Compile.CheckGrammar (inferLType) import GF.Compile.Compute (computeConcrete) import GF.Data.Operations @@ -36,9 +37,10 @@ checkTerm gr t = do checkTermAny gr mo t checkTermAny :: Grammar -> Ident -> Term -> Err Term -checkTermAny gr m t = do - t1 <- renameSourceTerm gr m t - justCheckLTerm gr t1 +checkTermAny gr m t = (fmap fst . runCheck) $ do + t <- renameSourceTerm gr m t + (t,_) <- inferLType gr [] t + return t computeTerm :: Grammar -> Term -> Err Term computeTerm = computeConcrete -- cgit v1.2.3