{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Distribution.Package
( module Distribution.Types.AbiHash
, module Distribution.Types.ComponentId
, module Distribution.Types.PackageId
, module Distribution.Types.UnitId
, module Distribution.Types.Module
, module Distribution.Types.PackageName
, module Distribution.Types.PkgconfigName
, module Distribution.Types.Dependency
, Package(..), packageName, packageVersion
, HasMungedPackageId(..), mungedName', mungedVersion'
, HasUnitId(..)
, PackageInstalled(..)
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Version
( Version )
import Distribution.Types.AbiHash
import Distribution.Types.ComponentId
import Distribution.Types.Dependency
import Distribution.Types.MungedPackageId
import Distribution.Types.PackageId
import Distribution.Types.UnitId
import Distribution.Types.Module
import Distribution.Types.MungedPackageName
import Distribution.Types.PackageName
import Distribution.Types.PkgconfigName
class Package pkg where
packageId :: pkg -> PackageIdentifier
mungedName' :: HasMungedPackageId pkg => pkg -> MungedPackageName
mungedName' :: forall pkg. HasMungedPackageId pkg => pkg -> MungedPackageName
mungedName' = MungedPackageId -> MungedPackageName
mungedName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall pkg. HasMungedPackageId pkg => pkg -> MungedPackageId
mungedId
mungedVersion' :: HasMungedPackageId munged => munged -> Version
mungedVersion' :: forall munged. HasMungedPackageId munged => munged -> Version
mungedVersion' = MungedPackageId -> Version
mungedVersion forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall pkg. HasMungedPackageId pkg => pkg -> MungedPackageId
mungedId
class HasMungedPackageId pkg where
mungedId :: pkg -> MungedPackageId
instance Package PackageIdentifier where
packageId :: PackageIdentifier -> PackageIdentifier
packageId = forall a. a -> a
id
packageName :: Package pkg => pkg -> PackageName
packageName :: forall pkg. Package pkg => pkg -> PackageName
packageName = PackageIdentifier -> PackageName
pkgName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall pkg. Package pkg => pkg -> PackageIdentifier
packageId
packageVersion :: Package pkg => pkg -> Version
packageVersion :: forall pkg. Package pkg => pkg -> Version
packageVersion = PackageIdentifier -> Version
pkgVersion forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall pkg. Package pkg => pkg -> PackageIdentifier
packageId
instance HasMungedPackageId MungedPackageId where
mungedId :: MungedPackageId -> MungedPackageId
mungedId = forall a. a -> a
id
class Package pkg => HasUnitId pkg where
installedUnitId :: pkg -> UnitId
class (HasUnitId pkg) => PackageInstalled pkg where
installedDepends :: pkg -> [UnitId]