Commit 59faddbf authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

IsNode instance for InstalledPackageInfo.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 0462e166
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
-- |
......@@ -49,6 +50,7 @@ import Distribution.Version
import Distribution.Text
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.Binary
import Distribution.Compat.Graph
import Text.PrettyPrint as Disp
import Data.Maybe (fromMaybe)
......@@ -120,6 +122,11 @@ instance Package.HasUnitId InstalledPackageInfo where
instance Package.PackageInstalled InstalledPackageInfo where
installedDepends = depends
instance IsNode InstalledPackageInfo where
type Key InstalledPackageInfo = UnitId
nodeKey = installedUnitId
nodeNeighbors = depends
emptyInstalledPackageInfo :: InstalledPackageInfo
emptyInstalledPackageInfo
= InstalledPackageInfo {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment