An OpenUnitId describes a (possibly partially) instantiated
Backpack component, with a description of how the holes are filled
in. Unlike OpenUnitId, the ModuleSubst is kept in a structured
form that allows for substitution (which fills in holes.) This form
of unit cannot be installed. It must first be converted to a
UnitId.
In the absence of Backpack, there are no holes to fill, so any such component always has an empty module substitution; thus we can lossily represent it as a 'DefiniteUnitId uid'.
For a source component using Backpack, however, there is more structure as components may be parametrized over some signatures, and these "holes" may be partially or wholly filled.
OpenUnitId plays an important role when we are mix-in linking, and is recorded to the installed packaged database for indefinite packages; however, for compiled packages that are fully instantiated, we instantiate OpenUnitId into UnitId.
For more details see the Backpack spec https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst
Constructors
IndefFullUnitId ComponentId OpenModuleSubstIdentifies a component which may have some unfilled holes; specifying its ComponentId and its OpenModuleSubst. TODO: Invariant that OpenModuleSubst is non-empty? See also the Text instance.
DefiniteUnitId DefUnitIdIdentifies a fully instantiated component, which has been compiled and abbreviated as a hash. The embedded UnitId MUST NOT be for an indefinite component; an OpenUnitId is guaranteed not to have any holes.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackData OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackOrd OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackRead OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackShow OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackGeneric OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackNFData OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackBinary OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackParsec OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackExample1 expression eitherParsec "foobar" :: Either String OpenUnitIdRight (DefiniteUnitId (DefUnitId {unDefUnitId = UnitId "foobar"}))
Example1 expression eitherParsec "foo[Str=text-1.2.3:Data.Text.Text]" :: Either String OpenUnitIdRight (IndefFullUnitId (ComponentId "foo") (fromList [(ModuleName "Str",OpenModule (DefiniteUnitId (DefUnitId {unDefUnitId = UnitId "text-1.2.3"})) (ModuleName "Data.Text.Text"))]))
Pretty OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackStructured OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Backpacktype Rep OpenUnitId = D1 ('MetaDataDefined in Cabal-syntax-3.12.1.0 · Distribution.Backpack"OpenUnitId"
"Distribution.Backpack"
"Cabal-syntax-3.12.1.0-3adc"
'False) (C1 ('MetaCons"IndefFullUnitId"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ComponentId) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OpenModuleSubst)) :+: C1 ('MetaCons"DefiniteUnitId"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DefUnitId)))