diff options
| author | krasimir <krasimir@chalmers.se> | 2009-10-02 22:52:14 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-10-02 22:52:14 +0000 |
| commit | d64419f2f25f0fb5a28bddf198dce6ac26b75296 (patch) | |
| tree | ff77790b4220eb7644c1661ed94ed96d633261b5 /src/GF/Grammar/API.hs | |
| parent | 8e799548618318c37760a2e915eb994745574748 (diff) | |
refactor GF.Infra.CheckM and use the CheckM monad in the renamer as well
Diffstat (limited to 'src/GF/Grammar/API.hs')
| -rw-r--r-- | src/GF/Grammar/API.hs | 10 |
1 files changed, 6 insertions, 4 deletions
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 |
