Commit c9336b1b authored by dterei's avatar dterei
Browse files

Clean of PackageConfig

parent 3ac28c00
-- |
-- Package configuration information: essentially the interface to Cabal, with
-- some utilities
-- --
-- (c) The University of Glasgow, 2004 -- (c) The University of Glasgow, 2004
-- --
module PackageConfig (
-- $package_naming
-- | Package configuration information: essentially the interface to Cabal, with some utilities -- * PackageId
mkPackageId, packageConfigId,
{-# 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
module PackageConfig ( -- * The PackageConfig type: information about a package
-- $package_naming PackageConfig,
InstalledPackageInfo_(..), display,
-- * PackageId Version(..),
mkPackageId, packageConfigId, PackageIdentifier(..),
defaultPackageConfig,
-- * The PackageConfig type: information about a package
PackageConfig,
InstalledPackageInfo_(..), display,
Version(..),
PackageIdentifier(..),
defaultPackageConfig,
packageConfigToInstalledPackageInfo, packageConfigToInstalledPackageInfo,
installedPackageInfoToPackageConfig, installedPackageInfoToPackageConfig
) where ) where
#include "HsVersions.h" #include "HsVersions.h"
import Maybes
import Module
import Distribution.InstalledPackageInfo import Distribution.InstalledPackageInfo
import Distribution.ModuleName import Distribution.ModuleName
import Distribution.Package hiding (PackageId) import Distribution.Package hiding (PackageId)
import Distribution.Text import Distribution.Text
import Distribution.Version 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. -- might need to extend it with some GHC-specific stuff, but for now it's fine.
type PackageConfig = InstalledPackageInfo_ Module.ModuleName type PackageConfig = InstalledPackageInfo_ Module.ModuleName
defaultPackageConfig :: PackageConfig defaultPackageConfig :: PackageConfig
defaultPackageConfig = emptyInstalledPackageInfo defaultPackageConfig = emptyInstalledPackageInfo
...@@ -51,9 +46,9 @@ defaultPackageConfig = emptyInstalledPackageInfo ...@@ -51,9 +46,9 @@ defaultPackageConfig = emptyInstalledPackageInfo
-- $package_naming -- $package_naming
-- #package_naming# -- #package_naming#
-- Mostly the compiler deals in terms of 'PackageName's, which don't -- 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 -- 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. -- package sub-system.
-- --
-- This means that in theory you could have multiple base packages installed -- This means that in theory you could have multiple base packages installed
...@@ -88,3 +83,4 @@ installedPackageInfoToPackageConfig ...@@ -88,3 +83,4 @@ installedPackageInfoToPackageConfig
hiddenModules = h })) = hiddenModules = h })) =
pkgconf{ exposedModules = map mkModuleName e, pkgconf{ exposedModules = map mkModuleName e,
hiddenModules = map mkModuleName h } hiddenModules = map mkModuleName h }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment