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%.
This commit is contained in:
hallgren
2013-11-05 13:11:10 +00:00
parent 74357cdedf
commit 3814841d7d
97 changed files with 312 additions and 335 deletions

View File

@@ -21,6 +21,8 @@ module PGF(
-- * Identifiers
CId, mkCId, wildCId,
showCId, readCId,
-- extra
ppCId, pIdent, bsCId,
-- * Languages
Language,
@@ -50,6 +52,8 @@ module PGF(
mkInt, unInt,
mkDouble, unDouble,
mkMeta, unMeta,
-- extra
pExpr,
-- * Operations
-- ** Linearization
@@ -111,6 +115,8 @@ module PGF(
Lemma, Analysis, Morpho,
lookupMorpho, buildMorpho, fullFormLexicon,
morphoMissing,
-- extra:
morphoKnown, isInMorpho,
-- ** Tokenizing
mkTokenizer,
@@ -124,6 +130,8 @@ module PGF(
gizaAlignment,
GraphvizOptions(..),
graphvizDefaults,
-- extra:
getDepLabels,
-- * Probabilities
Probabilities,
@@ -131,6 +139,8 @@ module PGF(
defaultProbabilities,
showProbabilities,
readProbabilitiesFromFile,
-- extra:
probTree, setProbabilities, rankTreesByProbs,
-- -- ** SortTop
-- forExample,
@@ -153,21 +163,20 @@ import PGF.Macros
import PGF.Expr (Tree)
import PGF.Morphology
import PGF.Data
import PGF.Binary
import PGF.Binary()
import PGF.Tokenizer
import qualified PGF.Forest as Forest
import qualified PGF.Parse as Parse
import PGF.Utilities(replace)
import GF.Data.Utilities (replace)
import Data.Char
--import Data.Char
import qualified Data.Map as Map
import qualified Data.IntMap as IntMap
import Data.Maybe
--import qualified Data.IntMap as IntMap
--import Data.Maybe
import Data.Binary
import Data.List(mapAccumL)
import System.Random (newStdGen)
import Control.Monad
--import System.Random (newStdGen)
--import Control.Monad
import Text.PrettyPrint
---------------------------------------------------