Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stack.Types.PackageIdentifier
Description
Package identifier (name-version).
Synopsis
- data PackageIdentifier = PackageIdentifier {}
- data PackageIdentifierRevision = PackageIdentifierRevision {}
- data CabalHash
- mkCabalHashFromSHA256 :: Text -> Either SomeException CabalHash
- computeCabalHash :: ByteString -> CabalHash
- showCabalHash :: CabalHash -> Text
- data CabalFileInfo
- toTuple :: PackageIdentifier -> (PackageName, Version)
- fromTuple :: (PackageName, Version) -> PackageIdentifier
- parsePackageIdentifier :: MonadThrow m => Text -> m PackageIdentifier
- parsePackageIdentifierFromString :: MonadThrow m => String -> m PackageIdentifier
- parsePackageIdentifierRevision :: MonadThrow m => Text -> m PackageIdentifierRevision
- packageIdentifierParser :: Parser PackageIdentifier
- packageIdentifierString :: PackageIdentifier -> String
- packageIdentifierRevisionString :: PackageIdentifierRevision -> String
- packageIdentifierText :: PackageIdentifier -> Text
- toCabalPackageIdentifier :: PackageIdentifier -> PackageIdentifier
- fromCabalPackageIdentifier :: PackageIdentifier -> PackageIdentifier
- data StaticSHA256
- mkStaticSHA256FromText :: Text -> Either SomeException StaticSHA256
- mkStaticSHA256FromFile :: MonadIO m => Path Abs File -> m StaticSHA256
- mkStaticSHA256FromDigest :: Digest SHA256 -> StaticSHA256
- staticSHA256ToText :: StaticSHA256 -> Text
- staticSHA256ToBase16 :: StaticSHA256 -> ByteString
- staticSHA256ToRaw :: StaticSHA256 -> ByteString
Documentation
data PackageIdentifier #
A pkg-ver combination.
Constructors
PackageIdentifier | |
Fields
|
Instances
data PackageIdentifierRevision #
A PackageIdentifier
combined with optionally specified Hackage
cabal file revision.
Constructors
PackageIdentifierRevision | |
Fields |
Instances
A cryptographic hash of a Cabal file.
Instances
Eq CabalHash # | |
Data CabalHash # | |
Defined in Stack.Types.PackageIdentifier Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CabalHash -> c CabalHash # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CabalHash # toConstr :: CabalHash -> Constr # dataTypeOf :: CabalHash -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CabalHash) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CabalHash) # gmapT :: (forall b. Data b => b -> b) -> CabalHash -> CabalHash # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CabalHash -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CabalHash -> r # gmapQ :: (forall d. Data d => d -> u) -> CabalHash -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CabalHash -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CabalHash -> m CabalHash # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CabalHash -> m CabalHash # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CabalHash -> m CabalHash # | |
Ord CabalHash # | |
Show CabalHash # | |
Generic CabalHash # | |
NFData CabalHash # | |
Defined in Stack.Types.PackageIdentifier | |
Hashable CabalHash # | |
Defined in Stack.Types.PackageIdentifier | |
Store CabalHash # | |
type Rep CabalHash # | |
Defined in Stack.Types.PackageIdentifier type Rep CabalHash = D1 (MetaData "CabalHash" "Stack.Types.PackageIdentifier" "stack-1.9.3-5ihSa7Nq9ixFkDyEyQZs8l" True) (C1 (MetaCons "CabalHash" PrefixI True) (S1 (MetaSel (Just "unCabalHash") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StaticSHA256))) |
mkCabalHashFromSHA256 :: Text -> Either SomeException CabalHash #
Generate a CabalHash
value from a base16-encoded SHA256 hash.
computeCabalHash :: ByteString -> CabalHash #
Compute a CabalHash
value from a cabal file's contents.
showCabalHash :: CabalHash -> Text #
data CabalFileInfo #
Information on the contents of a cabal file
Constructors
CFILatest | Take the latest revision of the cabal file available. This isn't reproducible at all, but the running assumption (not necessarily true) is that cabal file revisions do not change semantics of the build. |
CFIHash !(Maybe Int) !CabalHash | Identify by contents of the cabal file itself |
CFIRevision !Word | Identify by revision number, with 0 being the original and counting upward. |
Instances
toTuple :: PackageIdentifier -> (PackageName, Version) #
Convert from a package identifier to a tuple.
fromTuple :: (PackageName, Version) -> PackageIdentifier #
Convert from a tuple to a package identifier.
parsePackageIdentifier :: MonadThrow m => Text -> m PackageIdentifier #
Convenient way to parse a package identifier from a Text
.
parsePackageIdentifierFromString :: MonadThrow m => String -> m PackageIdentifier #
Convenience function for parsing from a Value
.
parsePackageIdentifierRevision :: MonadThrow m => Text -> m PackageIdentifierRevision #
Parse a PackageIdentifierRevision
packageIdentifierParser :: Parser PackageIdentifier #
A parser for a package-version pair.
packageIdentifierString :: PackageIdentifier -> String #
Get a string representation of the package identifier; name-ver.
packageIdentifierRevisionString :: PackageIdentifierRevision -> String #
Get a string representation of the package identifier with revision; name-ver[@hashtype:hash[,size]].
packageIdentifierText :: PackageIdentifier -> Text #
Get a Text representation of the package identifier; name-ver.
data StaticSHA256 #
A SHA256 hash, stored in a static size for more efficient serialization with store.
Instances
mkStaticSHA256FromText :: Text -> Either SomeException StaticSHA256 #
Generate a StaticSHA256
value from a base16-encoded SHA256 hash.
mkStaticSHA256FromFile :: MonadIO m => Path Abs File -> m StaticSHA256 #
Generate a StaticSHA256
value from the contents of a file.
staticSHA256ToText :: StaticSHA256 -> Text #
Convert a StaticSHA256
into a base16-encoded SHA256 hash.
staticSHA256ToBase16 :: StaticSHA256 -> ByteString #
Convert a StaticSHA256
into a base16-encoded SHA256 hash.