module GHC.Unit.Ppr
( UnitPprInfo (..)
)
where
import GHC.Prelude
import GHC.Utils.Outputable
import Data.Version
data UnitPprInfo = UnitPprInfo
{ unitPprPackageName :: String
, unitPprPackageVersion :: Version
, unitPprComponentName :: Maybe String
}
instance Outputable UnitPprInfo where
ppr pprinfo = text $ mconcat
[ unitPprPackageName pprinfo
, case unitPprPackageVersion pprinfo of
Version [] [] -> ""
version -> "-" ++ showVersion version
, case unitPprComponentName pprinfo of
Nothing -> ""
Just cname -> ":" ++ cname
]