{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module Distribution.Types.AbiDependency where
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Parsec
import Distribution.Pretty
import qualified Distribution.Compat.CharParsing as P
import qualified Distribution.Package as Package
import qualified Text.PrettyPrint as Disp
data AbiDependency = AbiDependency {
AbiDependency -> UnitId
depUnitId :: Package.UnitId,
AbiDependency -> AbiHash
depAbiHash :: Package.AbiHash
}
deriving (AbiDependency -> AbiDependency -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbiDependency -> AbiDependency -> Bool
$c/= :: AbiDependency -> AbiDependency -> Bool
== :: AbiDependency -> AbiDependency -> Bool
$c== :: AbiDependency -> AbiDependency -> Bool
Eq, forall x. Rep AbiDependency x -> AbiDependency
forall x. AbiDependency -> Rep AbiDependency x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AbiDependency x -> AbiDependency
$cfrom :: forall x. AbiDependency -> Rep AbiDependency x
Generic, ReadPrec [AbiDependency]
ReadPrec AbiDependency
Int -> ReadS AbiDependency
ReadS [AbiDependency]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AbiDependency]
$creadListPrec :: ReadPrec [AbiDependency]
readPrec :: ReadPrec AbiDependency
$creadPrec :: ReadPrec AbiDependency
readList :: ReadS [AbiDependency]
$creadList :: ReadS [AbiDependency]
readsPrec :: Int -> ReadS AbiDependency
$creadsPrec :: Int -> ReadS AbiDependency
Read, Int -> AbiDependency -> ShowS
[AbiDependency] -> ShowS
AbiDependency -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbiDependency] -> ShowS
$cshowList :: [AbiDependency] -> ShowS
show :: AbiDependency -> String
$cshow :: AbiDependency -> String
showsPrec :: Int -> AbiDependency -> ShowS
$cshowsPrec :: Int -> AbiDependency -> ShowS
Show, Typeable)
instance Pretty AbiDependency where
pretty :: AbiDependency -> Doc
pretty (AbiDependency UnitId
uid AbiHash
abi) =
forall a. Pretty a => a -> Doc
pretty UnitId
uid Doc -> Doc -> Doc
<<>> Char -> Doc
Disp.char Char
'=' Doc -> Doc -> Doc
<<>> forall a. Pretty a => a -> Doc
pretty AbiHash
abi
instance Parsec AbiDependency where
parsec :: forall (m :: * -> *). CabalParsing m => m AbiDependency
parsec = do
UnitId
uid <- forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
parsec
Char
_ <- forall (m :: * -> *). CharParsing m => Char -> m Char
P.char Char
'='
AbiHash
abi <- forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
parsec
forall (m :: * -> *) a. Monad m => a -> m a
return (UnitId -> AbiHash -> AbiDependency
AbiDependency UnitId
uid AbiHash
abi)
instance Binary AbiDependency
instance Structured AbiDependency
instance NFData AbiDependency where rnf :: AbiDependency -> ()
rnf = forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf