diff options
| author | hallgren <hallgren@chalmers.se> | 2013-09-19 18:23:47 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2013-09-19 18:23:47 +0000 |
| commit | 3d5b9bd1fd46a51651cbfbd45f03e5b878aebbac (patch) | |
| tree | 24e9cae9268da60b1a0d633ab4d9f970deee3905 /src/compiler/GF/Compile/Compute/ConcreteNew.hs | |
| parent | c08f42ce9f1a0dc123896a8c94da24bb19756141 (diff) | |
Make Ident abstract; imports of Data.ByteString.Char8 down from 29 to 16 modules
Most of the explicit uses of ByteStrings were eliminated by using identS,
identS = identC . BS.pack
which was found in GF.Grammar.CF and moved to GF.Infra.Ident. The function
prefixIdent :: String -> Ident -> Ident
allowed one additional import of ByteString to be eliminated. The functions
isArgIdent :: Ident -> Bool
getArgIndex :: Ident -> Maybe Int
were needed to eliminate explicit pattern matching on Ident from two modules.
Diffstat (limited to 'src/compiler/GF/Compile/Compute/ConcreteNew.hs')
| -rw-r--r-- | src/compiler/GF/Compile/Compute/ConcreteNew.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiler/GF/Compile/Compute/ConcreteNew.hs b/src/compiler/GF/Compile/Compute/ConcreteNew.hs index 3a05d62fb..3e87ea43a 100644 --- a/src/compiler/GF/Compile/Compute/ConcreteNew.hs +++ b/src/compiler/GF/Compile/Compute/ConcreteNew.hs @@ -19,7 +19,6 @@ import Control.Monad(ap,liftM,liftM2,mplus,unless) import Data.List (findIndex,intersect,isInfixOf,nub,elemIndex,(\\)) import Data.Char (isUpper,toUpper,toLower) import Text.PrettyPrint -import qualified Data.ByteString.Char8 as BS import qualified Data.Map as Map --import Debug.Trace(trace) @@ -80,7 +79,7 @@ resource env (m,c) = resourceValues :: SourceGrammar -> GlobalEnv resourceValues gr = env where - env = GE gr rvs (L NoLoc IW) + env = GE gr rvs (L NoLoc identW) rvs = Map.mapWithKey moduleResources (moduleMap gr) moduleResources m = Map.mapWithKey (moduleResource m) . jments moduleResource m c _info = do L l t <- lookupResDefLoc gr (m,c) @@ -115,7 +114,7 @@ value env t0 = Vr x -> var env x Q x@(m,f) | m == cPredef -> if f==cErrorType -- to be removed - then let p = identC (BS.pack "P") + then let p = identS "P" in const # value0 env (mkProd [(Implicit,p,typeType)] (Vr p) []) else const . flip VApp [] # predef f | otherwise -> const # resource env x --valueResDef (fst env) x |
