diff options
| author | hallgren <hallgren@chalmers.se> | 2013-11-05 13:11:10 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2013-11-05 13:11:10 +0000 |
| commit | 3814841d7d3b77b3f033cb98c1c0a04ac39435d7 (patch) | |
| tree | 1ad913a0a7ca870b7ec62db86afbc422cab97df1 /src/compiler/GF/Compile/Compute | |
| parent | 74357cdedf90178253d5d812931cb78a9bdf54aa (diff) | |
Eliminate mutual dependencies between the GF compiler and the PGF library
+ References to modules under src/compiler have been eliminated from the PGF
library (under src/runtime/haskell). Only two functions had to be moved (from
GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent
dependencies turned out to be vacuous.
+ In gf.cabal, the GF executable no longer directly depends on the PGF library
source directory, but only on the exposed library modules. This means that
there is less duplication in gf.cabal and that the 30 modules in the
PGF library will no longer be compiled twice while building GF.
To make this possible, additional PGF library modules have been exposed, even
though they should probably be considered for internal use only. They could
be collected in a PGF.Internal module, or marked as "unstable", to make
this explicit.
+ Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were
found and removed, reducing the total number of imports by ~15%.
Diffstat (limited to 'src/compiler/GF/Compile/Compute')
| -rw-r--r-- | src/compiler/GF/Compile/Compute/AppPredefined.hs | 2 | ||||
| -rw-r--r-- | src/compiler/GF/Compile/Compute/ConcreteLazy.hs | 8 | ||||
| -rw-r--r-- | src/compiler/GF/Compile/Compute/ConcreteNew.hs | 8 | ||||
| -rw-r--r-- | src/compiler/GF/Compile/Compute/Predef.hs | 8 | ||||
| -rw-r--r-- | src/compiler/GF/Compile/Compute/Value.hs | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/compiler/GF/Compile/Compute/AppPredefined.hs b/src/compiler/GF/Compile/Compute/AppPredefined.hs index 861a74a89..a597726c9 100644 --- a/src/compiler/GF/Compile/Compute/AppPredefined.hs +++ b/src/compiler/GF/Compile/Compute/AppPredefined.hs @@ -16,7 +16,7 @@ module GF.Compile.Compute.AppPredefined ( isInPredefined, typPredefined, arrityPredefined, predefModInfo, appPredefined ) where -import GF.Infra.Ident(identS) +--import GF.Infra.Ident(identS) import GF.Infra.Option import GF.Data.Operations import GF.Grammar diff --git a/src/compiler/GF/Compile/Compute/ConcreteLazy.hs b/src/compiler/GF/Compile/Compute/ConcreteLazy.hs index 0e3a4fb45..cef4c398c 100644 --- a/src/compiler/GF/Compile/Compute/ConcreteLazy.hs +++ b/src/compiler/GF/Compile/Compute/ConcreteLazy.hs @@ -17,9 +17,9 @@ module GF.Compile.Compute.ConcreteLazy (computeConcrete, computeTerm,checkPredef import GF.Data.Operations import GF.Grammar.Grammar import GF.Infra.Ident -import GF.Infra.Option +--import GF.Infra.Option import GF.Data.Str -import GF.Grammar.ShowTerm +--import GF.Grammar.ShowTerm import GF.Grammar.Printer import GF.Grammar.Predef import GF.Grammar.Macros @@ -30,8 +30,8 @@ import GF.Grammar.Lockfield (isLockLabel,unlockRecord) ---- import GF.Compile.Compute.AppPredefined -import Data.List (nub,intersperse) -import Control.Monad (liftM2, liftM) +import Data.List (nub) --intersperse +--import Control.Monad (liftM2, liftM) import Control.Monad.Identity import Text.PrettyPrint diff --git a/src/compiler/GF/Compile/Compute/ConcreteNew.hs b/src/compiler/GF/Compile/Compute/ConcreteNew.hs index 3e87ea43a..dd49fffed 100644 --- a/src/compiler/GF/Compile/Compute/ConcreteNew.hs +++ b/src/compiler/GF/Compile/Compute/ConcreteNew.hs @@ -9,15 +9,15 @@ import GF.Grammar hiding (Env, VGen, VApp, VRecType) import GF.Grammar.Lookup(lookupResDefLoc,allParamValues) import GF.Grammar.Predef(cPredef,cErrorType,cTok,cStr) import GF.Grammar.PatternMatch(matchPattern,measurePatt) -import GF.Grammar.Lockfield(unlockRecord,lockLabel,isLockLabel,lockRecType) +import GF.Grammar.Lockfield(lockLabel,isLockLabel,lockRecType) --unlockRecord import GF.Compile.Compute.Value hiding (Error) import GF.Compile.Compute.Predef(predef,predefName,delta) import GF.Data.Str(Str,glueStr,str2strings,str,sstr,plusStr,strTok) import GF.Data.Operations(Err,err,errIn,maybeErr,combinations,mapPairsM) -import GF.Data.Utilities(mapFst,mapSnd,mapBoth,apBoth,apSnd) +import GF.Data.Utilities(mapFst,mapSnd,mapBoth) import Control.Monad(ap,liftM,liftM2,mplus,unless) -import Data.List (findIndex,intersect,isInfixOf,nub,elemIndex,(\\)) -import Data.Char (isUpper,toUpper,toLower) +import Data.List (findIndex,intersect,nub,elemIndex,(\\)) --,isInfixOf +--import Data.Char (isUpper,toUpper,toLower) import Text.PrettyPrint import qualified Data.Map as Map --import Debug.Trace(trace) diff --git a/src/compiler/GF/Compile/Compute/Predef.hs b/src/compiler/GF/Compile/Compute/Predef.hs index b8b7f7c77..8c793502a 100644 --- a/src/compiler/GF/Compile/Compute/Predef.hs +++ b/src/compiler/GF/Compile/Compute/Predef.hs @@ -9,13 +9,13 @@ import Data.List (isInfixOf) import Data.Char (isUpper,toLower,toUpper) import Control.Monad(ap) -import GF.Data.Utilities (mapSnd,apBoth) +import GF.Data.Utilities (apBoth) --mapSnd import GF.Compile.Compute.Value -import GF.Infra.Ident (Ident,varX,showIdent) -import GF.Data.Operations(Err,err) +import GF.Infra.Ident (Ident,showIdent) --,varX +import GF.Data.Operations(Err) -- ,err import GF.Grammar.Predef -import PGF.Data(BindType(..)) +--import PGF.Data(BindType(..)) -------------------------------------------------------------------------------- class Predef a where diff --git a/src/compiler/GF/Compile/Compute/Value.hs b/src/compiler/GF/Compile/Compute/Value.hs index e72b06778..21a3eb20e 100644 --- a/src/compiler/GF/Compile/Compute/Value.hs +++ b/src/compiler/GF/Compile/Compute/Value.hs @@ -1,8 +1,8 @@ module GF.Compile.Compute.Value where -import GF.Grammar.Grammar(Label,Type,TInfo,MetaId,Patt,QIdent) +import GF.Grammar.Grammar(Label,Type,MetaId,Patt,QIdent) import PGF.Data(BindType) import GF.Infra.Ident(Ident) -import Text.Show.Functions +import Text.Show.Functions() import Data.Ix(Ix) -- | Self-contained (not quite) representation of values |
