Make “sublibrary” standard terminology in docs
[cabal.git] / Cabal / src / Distribution / Types / TargetInfo.hs
blob8f724d894d176d6096e3914b73b986308e800cb2
1 {-# LANGUAGE TypeFamilies #-}
3 module Distribution.Types.TargetInfo
4 ( TargetInfo (..)
5 ) where
7 import Distribution.Compat.Prelude
8 import Prelude ()
10 import Distribution.Types.Component
11 import Distribution.Types.ComponentLocalBuildInfo
12 import Distribution.Types.UnitId
14 import Distribution.Compat.Graph (IsNode (..))
16 -- | The 'TargetInfo' contains all the information necessary to build a
17 -- specific target (e.g., component/module/file) in a package. In
18 -- principle, one can get the 'Component' from a
19 -- 'ComponentLocalBuildInfo' and 'LocalBuildInfo', but it is much more
20 -- convenient to have the component in hand.
21 data TargetInfo = TargetInfo
22 { targetCLBI :: ComponentLocalBuildInfo
23 , targetComponent :: Component
24 -- TODO: BuildTargets supporting parsing these is dumb,
25 -- we don't have support for compiling single modules or
26 -- file paths. Accommodating it now is premature
27 -- generalization. Figure it out later.
28 -- targetSub :: Maybe (Either ModuleName FilePath)
31 instance IsNode TargetInfo where
32 type Key TargetInfo = UnitId
33 nodeKey = nodeKey . targetCLBI
34 nodeNeighbors = nodeNeighbors . targetCLBI