Make “sublibrary” standard terminology in docs
[cabal.git] / Cabal / src / Distribution / Backpack / FullUnitId.hs
blob0a751a66f2716bac578c07d5e2244d5666583a01
1 {-# LANGUAGE DeriveGeneric #-}
3 module Distribution.Backpack.FullUnitId
4 ( FullUnitId (..)
5 , FullDb
6 , expandOpenUnitId
7 , expandUnitId
8 ) where
10 import Distribution.Backpack
11 import Distribution.Compat.Prelude
12 import Distribution.Types.ComponentId
14 -- Unlike OpenUnitId, which could direct to a UnitId.
15 data FullUnitId = FullUnitId ComponentId OpenModuleSubst
16 deriving (Show, Generic)
18 type FullDb = DefUnitId -> FullUnitId
20 expandOpenUnitId :: FullDb -> OpenUnitId -> FullUnitId
21 expandOpenUnitId _db (IndefFullUnitId cid subst) =
22 FullUnitId cid subst
23 expandOpenUnitId db (DefiniteUnitId uid) =
24 expandUnitId db uid
26 expandUnitId :: FullDb -> DefUnitId -> FullUnitId
27 expandUnitId db uid = db uid