diff options
| author | hallgren <hallgren@chalmers.se> | 2014-10-20 15:05:43 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2014-10-20 15:05:43 +0000 |
| commit | 55aebadd5a64eb3f6a566168bbeeeb7cbb4ccb44 (patch) | |
| tree | f47b796fe513256dcb6117f3a1af5c752d4ddbe5 /src/compiler/GF/Grammar | |
| parent | bb1f0f3368f3ee2065b0e5ee74e3c45b0116e8a9 (diff) | |
Remove some dead code
* The following modules are no longer used and have been removed completely:
GF.Compile.Compute.ConcreteLazy
GF.Compile.Compute.ConcreteStrict
GF.Compile.Refresh
* The STM monad has been commented out. It was only used in
GF.Compile.SubExpOpt, where could be replaced with a plain State monad,
since no error handling was needed. One of the functions was hardwired to
the Err monad, but did in fact not use error handling, so it was turned
into a pure function.
* The function errVal has been renamed to fromErr (since it is analogous to
fromMaybe).
* Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places.
* Some additional old code that was already commented out has been removed.
Diffstat (limited to 'src/compiler/GF/Grammar')
| -rw-r--r-- | src/compiler/GF/Grammar/Analyse.hs | 2 | ||||
| -rw-r--r-- | src/compiler/GF/Grammar/Lookup.hs | 2 | ||||
| -rw-r--r-- | src/compiler/GF/Grammar/MMacros.hs | 2 | ||||
| -rw-r--r-- | src/compiler/GF/Grammar/Macros.hs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Grammar/Analyse.hs b/src/compiler/GF/Grammar/Analyse.hs index 023b76ad3..adab6fcf5 100644 --- a/src/compiler/GF/Grammar/Analyse.hs +++ b/src/compiler/GF/Grammar/Analyse.hs @@ -46,7 +46,7 @@ constantDeps :: SourceGrammar -> QIdent -> Err [QIdent] constantDeps sgr f = return $ nub $ iterFix more start where start = constants f more = concatMap constants - constants c = (c :) $ errVal [] $ do + constants c = (c :) $ fromErr [] $ do ts <- termsOfConstant sgr c return $ concatMap constantsInTerm ts diff --git a/src/compiler/GF/Grammar/Lookup.hs b/src/compiler/GF/Grammar/Lookup.hs index da75267de..e5ead0f13 100644 --- a/src/compiler/GF/Grammar/Lookup.hs +++ b/src/compiler/GF/Grammar/Lookup.hs @@ -123,7 +123,7 @@ lookupOrigInfo gr (m,c) = do i -> return (m,i) allOrigInfos :: SourceGrammar -> Ident -> [(QIdent,Info)] -allOrigInfos gr m = errVal [] $ do +allOrigInfos gr m = fromErr [] $ do mo <- lookupModule gr m return [((m,c),i) | (c,_) <- tree2list (jments mo), Ok (m,i) <- [lookupOrigInfo gr (m,c)]] diff --git a/src/compiler/GF/Grammar/MMacros.hs b/src/compiler/GF/Grammar/MMacros.hs index 66d8a857f..30271a2d5 100644 --- a/src/compiler/GF/Grammar/MMacros.hs +++ b/src/compiler/GF/Grammar/MMacros.hs @@ -151,7 +151,7 @@ substTerm ss g c = case c of _ -> c metaSubstExp :: MetaSubst -> [(MetaId,Exp)] -metaSubstExp msubst = [(m, errVal (meta2exp m) (val2expSafe v)) | (m,v) <- msubst] +metaSubstExp msubst = [(m, fromErr (meta2exp m) (val2expSafe v)) | (m,v) <- msubst] -- ** belong here rather than to computation diff --git a/src/compiler/GF/Grammar/Macros.hs b/src/compiler/GF/Grammar/Macros.hs index f5ddb7ae0..66ef50ce9 100644 --- a/src/compiler/GF/Grammar/Macros.hs +++ b/src/compiler/GF/Grammar/Macros.hs @@ -91,7 +91,7 @@ isRecursiveType t = in any (== c) cc isHigherOrderType :: Type -> Bool -isHigherOrderType t = errVal True $ do -- pessimistic choice +isHigherOrderType t = fromErr True $ do -- pessimistic choice co <- contextOfType t return $ not $ null [x | (_,x,Prod _ _ _ _) <- co] |
