1 {-# LANGUAGE DeriveFunctor #-}
3 module Distribution
.Types
.AnnotatedId
7 import Distribution
.Compat
.Prelude
10 import Distribution
.Package
11 import Distribution
.Types
.ComponentName
13 -- | An 'AnnotatedId' is a 'ComponentId', 'UnitId', etc.
14 -- which is annotated with some other useful information
15 -- that is useful for printing to users, etc.
17 -- Invariant: if ann_id x == ann_id y, then ann_pid x == ann_pid y
18 -- and ann_cname x == ann_cname y
19 data AnnotatedId
id = AnnotatedId
20 { ann_pid
:: PackageId
21 , ann_cname
:: ComponentName
24 deriving (Show, Functor
)
26 instance Eq
id => Eq
(AnnotatedId
id) where
27 x
== y
= ann_id x
== ann_id y
29 instance Ord
id => Ord
(AnnotatedId
id) where
30 compare x y
= compare (ann_id x
) (ann_id y
)
32 instance Package
(AnnotatedId
id) where