{-# LANGUAGE TypeFamilies #-}
module Distribution.Types.TargetInfo
( TargetInfo (..)
) where
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Types.Component
import Distribution.Types.ComponentLocalBuildInfo
import Distribution.Types.UnitId
import Distribution.Compat.Graph (IsNode (..))
data TargetInfo = TargetInfo
{ TargetInfo -> ComponentLocalBuildInfo
targetCLBI :: ComponentLocalBuildInfo
, TargetInfo -> Component
targetComponent :: Component
}
instance IsNode TargetInfo where
type Key TargetInfo = UnitId
nodeKey :: TargetInfo -> Key TargetInfo
nodeKey = ComponentLocalBuildInfo -> Key ComponentLocalBuildInfo
ComponentLocalBuildInfo -> UnitId
forall a. IsNode a => a -> Key a
nodeKey (ComponentLocalBuildInfo -> UnitId)
-> (TargetInfo -> ComponentLocalBuildInfo) -> TargetInfo -> UnitId
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TargetInfo -> ComponentLocalBuildInfo
targetCLBI
nodeNeighbors :: TargetInfo -> [Key TargetInfo]
nodeNeighbors = ComponentLocalBuildInfo -> [Key ComponentLocalBuildInfo]
ComponentLocalBuildInfo -> [UnitId]
forall a. IsNode a => a -> [Key a]
nodeNeighbors (ComponentLocalBuildInfo -> [UnitId])
-> (TargetInfo -> ComponentLocalBuildInfo)
-> TargetInfo
-> [UnitId]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TargetInfo -> ComponentLocalBuildInfo
targetCLBI