HORIZON HASKELLDocslts/ghc-10.0.x04404a62026-10-19Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 04404a6 · 2026-10-19

OpenUnitId

datadata OpenUnitId

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 parameterized 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

Instances12Eq, Data, Ord, Read, Show, Generic, …

DefUnitId

newtypenewtype DefUnitId

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.

Instances12Eq, Data, Ord, Read, Show, Generic, …

OpenModule

datadata OpenModule

Unlike a Module, an OpenModule is either an ordinary module from some unit, OR an OpenModuleVar, representing a hole that needs to be filled in. Substitutions are over module variables.

Instances13Eq, Data, Ord, Read, Show, Generic, …

OpenModuleSubst

Conversions to UnitId