summaryrefslogtreecommitdiff
path: root/compiler/main/PackageConfig.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/PackageConfig.hs')
-rw-r--r--compiler/main/PackageConfig.hs50
1 files changed, 23 insertions, 27 deletions
diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs
index 913e58c6fb..d34d9e1f5c 100644
--- a/compiler/main/PackageConfig.hs
+++ b/compiler/main/PackageConfig.hs
@@ -1,47 +1,42 @@
+-- |
+-- Package configuration information: essentially the interface to Cabal, with
+-- some utilities
--
-- (c) The University of Glasgow, 2004
--
+module PackageConfig (
+ -- $package_naming
--- | Package configuration information: essentially the interface to Cabal, with some utilities
-
-{-# OPTIONS -fno-warn-tabs #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and
--- detab the module (please do the detabbing in a separate patch). See
--- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
--- for details
+ -- * PackageId
+ mkPackageId, packageConfigId,
-module PackageConfig (
- -- $package_naming
-
- -- * PackageId
- mkPackageId, packageConfigId,
-
- -- * The PackageConfig type: information about a package
- PackageConfig,
- InstalledPackageInfo_(..), display,
- Version(..),
- PackageIdentifier(..),
- defaultPackageConfig,
+ -- * The PackageConfig type: information about a package
+ PackageConfig,
+ InstalledPackageInfo_(..), display,
+ Version(..),
+ PackageIdentifier(..),
+ defaultPackageConfig,
packageConfigToInstalledPackageInfo,
- installedPackageInfoToPackageConfig,
- ) where
+ installedPackageInfoToPackageConfig
+ ) where
#include "HsVersions.h"
-import Maybes
-import Module
import Distribution.InstalledPackageInfo
import Distribution.ModuleName
import Distribution.Package hiding (PackageId)
import Distribution.Text
import Distribution.Version
+import Maybes
+import Module
+
-- -----------------------------------------------------------------------------
--- Our PackageConfig type is just InstalledPackageInfo from Cabal. Later we
+-- Our PackageConfig type is just InstalledPackageInfo from Cabal. Later we
-- might need to extend it with some GHC-specific stuff, but for now it's fine.
type PackageConfig = InstalledPackageInfo_ Module.ModuleName
+
defaultPackageConfig :: PackageConfig
defaultPackageConfig = emptyInstalledPackageInfo
@@ -51,9 +46,9 @@ defaultPackageConfig = emptyInstalledPackageInfo
-- $package_naming
-- #package_naming#
-- Mostly the compiler deals in terms of 'PackageName's, which don't
--- have the version suffix. This is so that we don't need to know the
+-- have the version suffix. This is so that we don't need to know the
-- version for the @-package-name@ flag, or know the versions of
--- wired-in packages like @base@ & @rts@. Versions are confined to the
+-- wired-in packages like @base@ & @rts@. Versions are confined to the
-- package sub-system.
--
-- This means that in theory you could have multiple base packages installed
@@ -88,3 +83,4 @@ installedPackageInfoToPackageConfig
hiddenModules = h })) =
pkgconf{ exposedModules = map mkModuleName e,
hiddenModules = map mkModuleName h }
+