Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UnitId
- unUnitId :: UnitId -> String
- mkUnitId :: String -> UnitId
- data DefUnitId
- unsafeMkDefUnitId :: UnitId -> DefUnitId
- unDefUnitId :: DefUnitId -> UnitId
- newSimpleUnitId :: ComponentId -> UnitId
- mkLegacyUnitId :: PackageId -> UnitId
- getHSLibraryName :: UnitId -> String
- type InstalledPackageId = UnitId
Documentation
A unit identifier identifies a (possibly instantiated) package/component that can be installed the installed package database. There are several types of components that can be installed:
- A traditional library with no holes, so that
unitIdHash
isNothing
. In the absence of Backpack,UnitId
is the same as aComponentId
. - An indefinite, Backpack library with holes. In this case,
unitIdHash
is stillNothing
, but in the install, there are only interfaces, no compiled objects. - An instantiated Backpack library with all the holes
filled in.
unitIdHash
is aJust
a hash of the instantiating mapping.
A unit is a component plus the additional information on how the
holes are filled in. Thus there is a one to many relationship: for a
particular component there are many different ways of filling in the
holes, and each different combination is a unit (and has a separate
UnitId
).
UnitId
is distinct from OpenUnitId
, in that it is always
installed, whereas OpenUnitId
are intermediate unit identities
that arise during mixin linking, and don't necessarily correspond
to any actually installed unit. Since the mapping is not actually
recorded in a UnitId
, you can't actually substitute over them
(but you can substitute over OpenUnitId
). See also
Distribution.Backpack.FullUnitId for a mechanism for expanding an
instantiated UnitId
to retrieve its mapping.
Backwards compatibility note: if you need to get the string
representation of a UnitId to pass, e.g., as a -package-id
flag, use the display
function, which will work on all
versions of Cabal.
Instances
Eq UnitId # | |
Data UnitId # | |
Defined in Distribution.Types.UnitId gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnitId -> c UnitId # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnitId # toConstr :: UnitId -> Constr # dataTypeOf :: UnitId -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnitId) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnitId) # gmapT :: (forall b. Data b => b -> b) -> UnitId -> UnitId # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnitId -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnitId -> r # gmapQ :: (forall d. Data d => d -> u) -> UnitId -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnitId -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId # | |
Ord UnitId # | |
Read UnitId # | |
Show UnitId # | |
IsString UnitId # | Since: 2.0.0.2 |
Defined in Distribution.Types.UnitId fromString :: String -> UnitId # | |
Generic UnitId # | |
Binary UnitId # | |
NFData UnitId # | |
Defined in Distribution.Types.UnitId | |
Pretty UnitId # | The textual format for |
Defined in Distribution.Types.UnitId | |
Parsec UnitId # | The textual format for |
Defined in Distribution.Types.UnitId parsec :: CabalParsing m => m UnitId # | |
Text UnitId # | |
type Rep UnitId # | |
Defined in Distribution.Types.UnitId |
unUnitId :: UnitId -> String #
If you need backwards compatibility, consider using display
instead, which is supported by all versions of Cabal.
A UnitId
for a definite package. The DefUnitId
invariant says
that a UnitId
identified this way is definite; i.e., it has no
unfilled holes.
Instances
Eq DefUnitId # | |
Data DefUnitId # | |
Defined in Distribution.Types.UnitId gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DefUnitId -> c DefUnitId # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DefUnitId # toConstr :: DefUnitId -> Constr # dataTypeOf :: DefUnitId -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DefUnitId) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DefUnitId) # gmapT :: (forall b. Data b => b -> b) -> DefUnitId -> DefUnitId # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DefUnitId -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DefUnitId -> r # gmapQ :: (forall d. Data d => d -> u) -> DefUnitId -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DefUnitId -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DefUnitId -> m DefUnitId # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DefUnitId -> m DefUnitId # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DefUnitId -> m DefUnitId # | |
Ord DefUnitId # | |
Defined in Distribution.Types.UnitId | |
Read DefUnitId # | |
Show DefUnitId # | |
Generic DefUnitId # | |
Binary DefUnitId # | |
NFData DefUnitId # | |
Defined in Distribution.Types.UnitId | |
Pretty DefUnitId # | |
Defined in Distribution.Types.UnitId | |
Parsec DefUnitId # | |
Defined in Distribution.Types.UnitId parsec :: CabalParsing m => m DefUnitId # | |
Text DefUnitId # | |
type Rep DefUnitId # | |
Defined in Distribution.Types.UnitId |
unsafeMkDefUnitId :: UnitId -> DefUnitId #
unDefUnitId :: DefUnitId -> UnitId #
newSimpleUnitId :: ComponentId -> UnitId #
Create a unit identity with no associated hash directly
from a ComponentId
.
mkLegacyUnitId :: PackageId -> UnitId #
Make an old-style UnitId from a package identifier. Assumed to be for the public library
getHSLibraryName :: UnitId -> String #
Returns library name prefixed with HS, suitable for filenames
type InstalledPackageId = UnitId #
Deprecated: Use UnitId instead. This symbol will be removed in Cabal-3.0 (est. Mar 2019).