Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Pantry.Types
Synopsis
- data PantryConfig = PantryConfig {
- pcPackageIndex :: !PackageIndexConfig
- pcHpackExecutable :: !HpackExecutable
- pcRootDir :: !(Path Abs Dir)
- pcStorage :: !Storage
- pcUpdateRef :: !(MVar Bool)
- pcParsedCabalFilesRawImmutable :: !(IORef (Map RawPackageLocationImmutable GenericPackageDescription))
- pcParsedCabalFilesMutable :: !(IORef (Map (Path Abs Dir) (PrintWarnings -> IO GenericPackageDescription, PackageName, Path Abs File)))
- pcConnectionCount :: !Int
- pcCasaConfig :: !(Maybe (CasaRepoPrefix, Int))
- pcSnapshotLocation :: SnapName -> RawSnapshotLocation
- data PackageIndexConfig = PackageIndexConfig {}
- data HackageSecurityConfig = HackageSecurityConfig {
- hscKeyIds :: ![Text]
- hscKeyThreshold :: !Int
- hscIgnoreExpiry :: !Bool
- defaultHackageSecurityConfig :: HackageSecurityConfig
- data Storage = Storage {
- withStorage_ :: forall env a. HasLogFunc env => ReaderT SqlBackend (RIO env) a -> RIO env a
- withWriteLock_ :: forall env a. HasLogFunc env => RIO env a -> RIO env a
- class HasPantryConfig env where
- pantryConfigL :: Lens' env PantryConfig
- data BlobKey = BlobKey !SHA256 !FileSize
- data PackageName
- data Version
- data PackageIdentifier = PackageIdentifier {}
- newtype Revision = Revision Word
- data ModuleName
- data CabalFileInfo
- data PrintWarnings
- newtype PackageNameP = PackageNameP {}
- newtype VersionP = VersionP {}
- newtype ModuleNameP = ModuleNameP {}
- data PackageIdentifierRevision = PackageIdentifierRevision !PackageName !Version !CabalFileInfo
- pirForHash :: PackageIdentifier -> BlobKey -> PackageIdentifierRevision
- data FileType
- data BuildFile
- newtype FileSize = FileSize Word
- data TreeEntry = TreeEntry {}
- data SafeFilePath
- unSafeFilePath :: SafeFilePath -> Text
- mkSafeFilePath :: Text -> Maybe SafeFilePath
- safeFilePathToPath :: MonadThrow m => Path Abs Dir -> SafeFilePath -> m (Path Abs File)
- hpackSafeFilePath :: SafeFilePath
- newtype TreeKey = TreeKey BlobKey
- newtype Tree = TreeMap (Map SafeFilePath TreeEntry)
- renderTree :: Tree -> ByteString
- parseTree :: ByteString -> Maybe Tree
- parseTreeM :: MonadThrow m => (BlobKey, ByteString) -> m (TreeKey, Tree)
- data SHA256
- data Unresolved a
- resolvePaths :: MonadIO m => Maybe (Path Abs Dir) -> Unresolved a -> m a
- data Package = Package {}
- data PackageCabal
- data PHpack = PHpack {
- phOriginal :: !TreeEntry
- phGenerated :: !TreeEntry
- phVersion :: !Version
- data RawPackageLocation
- data PackageLocation
- toRawPL :: PackageLocation -> RawPackageLocation
- data RawPackageLocationImmutable
- data PackageLocationImmutable
- toRawPLI :: PackageLocationImmutable -> RawPackageLocationImmutable
- data RawArchive = RawArchive {
- raLocation :: !ArchiveLocation
- raHash :: !(Maybe SHA256)
- raSize :: !(Maybe FileSize)
- raSubdir :: !Text
- data Archive = Archive {}
- toRawArchive :: Archive -> RawArchive
- data Repo = Repo {
- repoUrl :: !Text
- repoCommit :: !Text
- repoType :: !RepoType
- repoSubdir :: !Text
- data AggregateRepo = AggregateRepo {
- aRepo :: !SimpleRepo
- aRepoSubdirs :: [(Text, RawPackageMetadata)]
- data SimpleRepo = SimpleRepo {}
- toAggregateRepos :: [(Repo, RawPackageMetadata)] -> [AggregateRepo]
- rToSimpleRepo :: Repo -> SimpleRepo
- arToSimpleRepo :: AggregateRepo -> SimpleRepo
- data RepoType
- parsePackageIdentifier :: String -> Maybe PackageIdentifier
- parsePackageName :: String -> Maybe PackageName
- parsePackageNameThrowing :: MonadThrow m => String -> m PackageName
- parseFlagName :: String -> Maybe FlagName
- parseVersion :: String -> Maybe Version
- parseVersionThrowing :: MonadThrow m => String -> m Version
- packageIdentifierString :: PackageIdentifier -> String
- packageNameString :: PackageName -> String
- flagNameString :: FlagName -> String
- versionString :: Version -> String
- moduleNameString :: ModuleName -> String
- data OptionalSubdirs
- data ArchiveLocation
- = ALUrl !Text
- | ALFilePath !(ResolvedPath File)
- newtype RelFilePath = RelFilePath Text
- newtype CabalString a = CabalString {
- unCabalString :: a
- toCabalStringMap :: Map a v -> Map (CabalString a) v
- unCabalStringMap :: Map (CabalString a) v -> Map a v
- parsePackageIdentifierRevision :: Text -> Either PantryException PackageIdentifierRevision
- data Mismatch a = Mismatch {
- mismatchExpected :: !a
- mismatchActual :: !a
- data PantryException
- = PackageIdentifierRevisionParseFail !Text
- | InvalidCabalFile !(Either RawPackageLocationImmutable (Path Abs File)) !(Maybe Version) ![PError] ![PWarning]
- | TreeWithoutCabalFile !RawPackageLocationImmutable
- | TreeWithMultipleCabalFiles !RawPackageLocationImmutable ![SafeFilePath]
- | MismatchedCabalName !(Path Abs File) !PackageName
- | NoLocalPackageDirFound !(Path Abs Dir)
- | NoCabalFileFound !(Path Abs Dir)
- | MultipleCabalFilesFound !(Path Abs Dir) ![Path Abs File]
- | InvalidWantedCompiler !Text
- | InvalidSnapshotLocation !(Path Abs Dir) !Text
- | InvalidOverrideCompiler !WantedCompiler !WantedCompiler
- | InvalidFilePathSnapshot !Text
- | InvalidSnapshot !RawSnapshotLocation !SomeException
- | MismatchedPackageMetadata !RawPackageLocationImmutable !RawPackageMetadata !(Maybe TreeKey) !PackageIdentifier
- | Non200ResponseStatus !Status
- | InvalidBlobKey !(Mismatch BlobKey)
- | Couldn'tParseSnapshot !RawSnapshotLocation !String
- | WrongCabalFileName !RawPackageLocationImmutable !SafeFilePath !PackageName
- | DownloadInvalidSHA256 !Text !(Mismatch SHA256)
- | DownloadInvalidSize !Text !(Mismatch FileSize)
- | DownloadTooLarge !Text !(Mismatch FileSize)
- | LocalInvalidSHA256 !(Path Abs File) !(Mismatch SHA256)
- | LocalInvalidSize !(Path Abs File) !(Mismatch FileSize)
- | UnknownArchiveType !ArchiveLocation
- | InvalidTarFileType !ArchiveLocation !FilePath !FileType
- | UnsupportedTarball !ArchiveLocation !Text
- | NoHackageCryptographicHash !PackageIdentifier
- | FailedToCloneRepo !SimpleRepo
- | TreeReferencesMissingBlob !RawPackageLocationImmutable !SafeFilePath !BlobKey
- | CompletePackageMetadataMismatch !RawPackageLocationImmutable !PackageMetadata
- | CRC32Mismatch !ArchiveLocation !FilePath !(Mismatch Word32)
- | UnknownHackagePackage !PackageIdentifierRevision !FuzzyResults
- | CannotCompleteRepoNonSHA1 !Repo
- | MutablePackageLocationFromUrl !Text
- | MismatchedCabalFileForHackage !PackageIdentifierRevision !(Mismatch PackageIdentifier)
- | PackageNameParseFail !Text
- | PackageVersionParseFail !Text
- | InvalidCabalFilePath !(Path Abs File)
- | DuplicatePackageNames !Utf8Builder ![(PackageName, [RawPackageLocationImmutable])]
- | MigrationFailure !Text !(Path Abs File) !SomeException
- | NoCasaConfig
- | InvalidTreeFromCasa !BlobKey !ByteString
- | ParseSnapNameException !Text
- | HpackLibraryException !(Path Abs File) !String
- | HpackExeException !FilePath !(Path Abs Dir) !SomeException
- data FuzzyResults
- data ResolvedPath t = ResolvedPath {
- resolvedRelative :: !RelFilePath
- resolvedAbsolute :: !(Path Abs t)
- data HpackExecutable
- data WantedCompiler
- snapshotLocation :: HasPantryConfig env => SnapName -> RIO env RawSnapshotLocation
- defaultSnapshotLocation :: SnapName -> RawSnapshotLocation
- data SnapName
- parseSnapName :: MonadThrow m => Text -> m SnapName
- data RawSnapshotLocation
- = RSLCompiler !WantedCompiler
- | RSLUrl !Text !(Maybe BlobKey)
- | RSLFilePath !(ResolvedPath File)
- | RSLSynonym !SnapName
- data SnapshotLocation
- = SLCompiler !WantedCompiler
- | SLUrl !Text !BlobKey
- | SLFilePath !(ResolvedPath File)
- toRawSL :: SnapshotLocation -> RawSnapshotLocation
- parseHackageText :: Text -> Either PantryException (PackageIdentifier, BlobKey)
- parseRawSnapshotLocation :: Text -> Unresolved RawSnapshotLocation
- data RawSnapshotLayer = RawSnapshotLayer {
- rslParent :: !RawSnapshotLocation
- rslCompiler :: !(Maybe WantedCompiler)
- rslLocations :: ![RawPackageLocationImmutable]
- rslDropPackages :: !(Set PackageName)
- rslFlags :: !(Map PackageName (Map FlagName Bool))
- rslHidden :: !(Map PackageName Bool)
- rslGhcOptions :: !(Map PackageName [Text])
- rslPublishTime :: !(Maybe UTCTime)
- data SnapshotLayer = SnapshotLayer {
- slParent :: !SnapshotLocation
- slCompiler :: !(Maybe WantedCompiler)
- slLocations :: ![PackageLocationImmutable]
- slDropPackages :: !(Set PackageName)
- slFlags :: !(Map PackageName (Map FlagName Bool))
- slHidden :: !(Map PackageName Bool)
- slGhcOptions :: !(Map PackageName [Text])
- slPublishTime :: !(Maybe UTCTime)
- toRawSnapshotLayer :: SnapshotLayer -> RawSnapshotLayer
- data RawSnapshot = RawSnapshot {
- rsCompiler :: !WantedCompiler
- rsPackages :: !(Map PackageName RawSnapshotPackage)
- rsDrop :: !(Set PackageName)
- data Snapshot = Snapshot {}
- data RawSnapshotPackage = RawSnapshotPackage {
- rspLocation :: !RawPackageLocationImmutable
- rspFlags :: !(Map FlagName Bool)
- rspHidden :: !Bool
- rspGhcOptions :: ![Text]
- data SnapshotPackage = SnapshotPackage {
- spLocation :: !PackageLocationImmutable
- spFlags :: !(Map FlagName Bool)
- spHidden :: !Bool
- spGhcOptions :: ![Text]
- parseWantedCompiler :: Text -> Either PantryException WantedCompiler
- data RawPackageMetadata = RawPackageMetadata {
- rpmName :: !(Maybe PackageName)
- rpmVersion :: !(Maybe Version)
- rpmTreeKey :: !(Maybe TreeKey)
- data PackageMetadata = PackageMetadata {
- pmIdent :: !PackageIdentifier
- pmTreeKey :: !TreeKey
- toRawPM :: PackageMetadata -> RawPackageMetadata
- cabalFileName :: PackageName -> SafeFilePath
- newtype SnapshotCacheHash = SnapshotCacheHash {}
- getGlobalHintsFile :: HasPantryConfig env => RIO env (Path Abs File)
- bsToBlobKey :: ByteString -> BlobKey
- warnMissingCabalFile :: HasLogFunc env => RawPackageLocationImmutable -> RIO env ()
- connRDBMS :: SqlBackend -> Text
Documentation
data PantryConfig Source #
Configuration value used by the entire pantry package. Create one using
withPantryConfig
or withPantryConfig'
. See also PantryApp
for a
convenience approach to using pantry.
Since: 0.1.0.0
Constructors
PantryConfig | |
Fields
|
data PackageIndexConfig Source #
Configuration to securely download package metadata and contents. For most
purposes, you'll want to use the default Hackage settings via
defaultPackageIndexConfig
.
NOTE It's highly recommended to only use the official Hackage server or a mirror. See https://github.com/commercialhaskell/stack/issues/4137.
Since: 0.6.0
Constructors
PackageIndexConfig | |
Fields |
Instances
Show PackageIndexConfig Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> PackageIndexConfig -> ShowS # show :: PackageIndexConfig -> String # showList :: [PackageIndexConfig] -> ShowS # | |
FromJSON (WithJSONWarnings PackageIndexConfig) Source # | If the Since: 0.6.0 |
Defined in Pantry.Types Methods parseJSON :: Value -> Parser (WithJSONWarnings PackageIndexConfig) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageIndexConfig] # |
data HackageSecurityConfig Source #
Configuration for Hackage Security to securely download package metadata
and contents. For most purposes, you'll want to use the default Hackage
settings via defaultHackageSecurityConfig
.
NOTE It's highly recommended to only use the official Hackage server or a mirror. See https://github.com/commercialhaskell/stack/issues/4137.
Since: 0.6.0
Constructors
HackageSecurityConfig | |
Fields
|
Instances
Show HackageSecurityConfig Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> HackageSecurityConfig -> ShowS # show :: HackageSecurityConfig -> String # showList :: [HackageSecurityConfig] -> ShowS # | |
FromJSON (WithJSONWarnings HackageSecurityConfig) Source # | If the Since: 0.1.1.0 |
Defined in Pantry.Types Methods parseJSON :: Value -> Parser (WithJSONWarnings HackageSecurityConfig) # parseJSONList :: Value -> Parser [WithJSONWarnings HackageSecurityConfig] # |
defaultHackageSecurityConfig :: HackageSecurityConfig Source #
Default HackageSecurityConfig
value using the official Hackage server.
The value of the hscIgnoreExpiry
field is True
.
Since: 0.7.0
Represents a SQL database connection.
Constructors
Storage | |
Fields
|
class HasPantryConfig env where Source #
An environment which contains a PantryConfig
.
Since: 0.1.0.0
Methods
pantryConfigL :: Lens' env PantryConfig Source #
Lens to get or set the PantryConfig
Since: 0.1.0.0
A key for looking up a blob, which combines the SHA256 hash of the contents and the file size.
The file size may seem redundant with the hash. However, it is necessary for safely downloading blobs from an untrusted source. See https://www.fpcomplete.com/blog/2018/07/pantry-part-2-trees-keys.
Since: 0.1.0.0
Instances
FromJSON BlobKey Source # | |
ToJSON BlobKey Source # | |
Defined in Pantry.Types | |
Generic BlobKey Source # | |
Show BlobKey Source # | |
NFData BlobKey Source # | |
Defined in Pantry.Types | |
Eq BlobKey Source # | |
Ord BlobKey Source # | |
Display BlobKey Source # | |
Defined in Pantry.Types | |
type Rep BlobKey Source # | |
Defined in Pantry.Types type Rep BlobKey = D1 ('MetaData "BlobKey" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "BlobKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SHA256) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FileSize))) |
data PackageName #
A package name.
Use mkPackageName
and unPackageName
to convert from/to a
String
.
This type is opaque since Cabal-2.0
Since: Cabal-2.0.0.2
Instances
A Version
represents the version of a software entity.
Instances of Eq
and Ord
are provided, which gives exact
equality and lexicographic ordering of the version number
components (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.).
This type is opaque and distinct from the Version
type in
Data.Version since Cabal-2.0
. The difference extends to the
Binary
instance using a different (and more compact) encoding.
Since: Cabal-2.0.0.2
Instances
data PackageIdentifier #
The name and version of a package.
Constructors
PackageIdentifier | |
Fields
|
Instances
The revision number of a package from Hackage, counting upwards from 0 (the original cabal file).
See caveats on CFIRevision
.
Since: 0.1.0.0
Instances
Data Revision Source # | |
Defined in Pantry.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Revision -> c Revision # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Revision # toConstr :: Revision -> Constr # dataTypeOf :: Revision -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Revision) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Revision) # gmapT :: (forall b. Data b => b -> b) -> Revision -> Revision # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Revision -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Revision -> r # gmapQ :: (forall d. Data d => d -> u) -> Revision -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Revision -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Revision -> m Revision # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Revision -> m Revision # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Revision -> m Revision # | |
Generic Revision Source # | |
Show Revision Source # | |
NFData Revision Source # | |
Defined in Pantry.Types | |
Eq Revision Source # | |
Ord Revision Source # | |
Defined in Pantry.Types | |
Hashable Revision Source # | |
Defined in Pantry.Types | |
PersistField Revision Source # | |
Defined in Pantry.Types Methods toPersistValue :: Revision -> PersistValue # | |
PersistFieldSql Revision Source # | |
Display Revision Source # | |
Defined in Pantry.Types | |
type Rep Revision Source # | |
Defined in Pantry.Types |
data ModuleName #
A valid Haskell module name.
Instances
data CabalFileInfo Source #
How to choose a cabal file for a package from Hackage. This is to work with
Hackage cabal file revisions, which makes PackageIdentifier
insufficient
for specifying a package from Hackage.
Since: 0.1.0.0
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. Since: 0.1.0.0 |
CFIHash !SHA256 !(Maybe FileSize) | Identify by contents of the cabal file itself. Only reason for
Since: 0.1.0.0 |
CFIRevision !Revision | Identify by revision number, with 0 being the original and
counting upward. This relies on Hackage providing consistent
versioning. Since: 0.1.0.0 |
Instances
data PrintWarnings Source #
Should we print warnings when loading a cabal file?
Since: 0.1.0.0
Constructors
YesPrintWarnings | |
NoPrintWarnings |
newtype PackageNameP Source #
Constructors
PackageNameP | |
Fields |
Instances
Constructors
VersionP | |
Fields |
Instances
FromJSON VersionP Source # | |
ToJSON VersionP Source # | |
Defined in Pantry.Types | |
Read VersionP Source # | |
Show VersionP Source # | |
NFData VersionP Source # | |
Defined in Pantry.Types | |
Eq VersionP Source # | |
Ord VersionP Source # | |
Defined in Pantry.Types | |
PersistField VersionP Source # | |
Defined in Pantry.Types Methods toPersistValue :: VersionP -> PersistValue # | |
PersistFieldSql VersionP Source # | |
Display VersionP Source # | |
Defined in Pantry.Types |
newtype ModuleNameP Source #
Constructors
ModuleNameP | |
Fields |
Instances
data PackageIdentifierRevision Source #
A full specification for a package from Hackage, including the package name, version, and how to load up the correct cabal file revision.
Since: 0.1.0.0
Constructors
PackageIdentifierRevision !PackageName !Version !CabalFileInfo |
Instances
pirForHash :: PackageIdentifier -> BlobKey -> PackageIdentifierRevision Source #
Package identifier and revision with a specified cabal file hash
Since: 0.1.0.0
Constructors
FTNormal | |
FTExecutable |
Instances
Bounded FileType Source # | |
Enum FileType Source # | |
Show FileType Source # | |
Eq FileType Source # | |
Ord FileType Source # | |
Defined in Pantry.Types | |
PersistField FileType Source # | |
Defined in Pantry.Types Methods toPersistValue :: FileType -> PersistValue # | |
PersistFieldSql FileType Source # | |
Constructors
BFCabal !SafeFilePath !TreeEntry | |
BFHpack !TreeEntry |
Instances
File size in bytes
Since: 0.1.0.0
Instances
FromJSON FileSize Source # | |
ToJSON FileSize Source # | |
Defined in Pantry.Types | |
Generic FileSize Source # | |
Show FileSize Source # | |
NFData FileSize Source # | |
Defined in Pantry.Types | |
Eq FileSize Source # | |
Ord FileSize Source # | |
Defined in Pantry.Types | |
Hashable FileSize Source # | |
Defined in Pantry.Types | |
PersistField FileSize Source # | |
Defined in Pantry.Types Methods toPersistValue :: FileSize -> PersistValue # | |
PersistFieldSql FileSize Source # | |
Display FileSize Source # | |
Defined in Pantry.Types | |
type Rep FileSize Source # | |
Defined in Pantry.Types |
Instances
Show TreeEntry Source # | |
Eq TreeEntry Source # | |
Ord TreeEntry Source # | |
data SafeFilePath Source #
Instances
Show SafeFilePath Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> SafeFilePath -> ShowS # show :: SafeFilePath -> String # showList :: [SafeFilePath] -> ShowS # | |
Eq SafeFilePath Source # | |
Defined in Pantry.Types | |
Ord SafeFilePath Source # | |
Defined in Pantry.Types Methods compare :: SafeFilePath -> SafeFilePath -> Ordering # (<) :: SafeFilePath -> SafeFilePath -> Bool # (<=) :: SafeFilePath -> SafeFilePath -> Bool # (>) :: SafeFilePath -> SafeFilePath -> Bool # (>=) :: SafeFilePath -> SafeFilePath -> Bool # max :: SafeFilePath -> SafeFilePath -> SafeFilePath # min :: SafeFilePath -> SafeFilePath -> SafeFilePath # | |
PersistField SafeFilePath Source # | |
Defined in Pantry.Types Methods toPersistValue :: SafeFilePath -> PersistValue # fromPersistValue :: PersistValue -> Either Text SafeFilePath # | |
PersistFieldSql SafeFilePath Source # | |
Defined in Pantry.Types Methods sqlType :: Proxy SafeFilePath -> SqlType # | |
Display SafeFilePath Source # | |
Defined in Pantry.Types |
unSafeFilePath :: SafeFilePath -> Text Source #
mkSafeFilePath :: Text -> Maybe SafeFilePath Source #
safeFilePathToPath :: MonadThrow m => Path Abs Dir -> SafeFilePath -> m (Path Abs File) Source #
hpackSafeFilePath :: SafeFilePath Source #
SafeFilePath for `package.yaml` file.
The hash of the binary representation of a Tree
.
Since: 0.1.0.0
Instances
FromJSON TreeKey Source # | |
ToJSON TreeKey Source # | |
Defined in Pantry.Types | |
Generic TreeKey Source # | |
Show TreeKey Source # | |
NFData TreeKey Source # | |
Defined in Pantry.Types | |
Eq TreeKey Source # | |
Ord TreeKey Source # | |
Display TreeKey Source # | |
Defined in Pantry.Types | |
type Rep TreeKey Source # | |
Defined in Pantry.Types |
Represents the contents of a tree, which is a mapping from
relative file paths to TreeEntry
s.
Since: 0.1.0.0
Constructors
TreeMap (Map SafeFilePath TreeEntry) |
renderTree :: Tree -> ByteString Source #
parseTreeM :: MonadThrow m => (BlobKey, ByteString) -> m (TreeKey, Tree) Source #
A SHA256 hash, stored in a static size for more efficient memory representation.
Since: 0.1.0.0
Instances
FromJSON SHA256 Source # | |
ToJSON SHA256 Source # | |
Defined in Pantry.SHA256 | |
Data SHA256 Source # | |
Defined in Pantry.SHA256 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA256 -> c SHA256 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA256 # toConstr :: SHA256 -> Constr # dataTypeOf :: SHA256 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA256) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA256) # gmapT :: (forall b. Data b => b -> b) -> SHA256 -> SHA256 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA256 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA256 -> r # gmapQ :: (forall d. Data d => d -> u) -> SHA256 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA256 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA256 -> m SHA256 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA256 -> m SHA256 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA256 -> m SHA256 # | |
Generic SHA256 Source # | |
Show SHA256 Source # | |
NFData SHA256 Source # | |
Defined in Pantry.SHA256 | |
Eq SHA256 Source # | |
Ord SHA256 Source # | |
Hashable SHA256 Source # | |
Defined in Pantry.SHA256 | |
PersistField SHA256 Source # | |
Defined in Pantry.SHA256 Methods toPersistValue :: SHA256 -> PersistValue # | |
PersistFieldSql SHA256 Source # | |
Display SHA256 Source # | |
Defined in Pantry.SHA256 | |
type Rep SHA256 Source # | |
Defined in Pantry.SHA256 |
data Unresolved a Source #
Wraps a value which potentially contains relative paths. Needs to be provided with a base directory to resolve these paths.
Unwrap this using resolvePaths
.
Since: 0.1.0.0
Instances
Arguments
:: MonadIO m | |
=> Maybe (Path Abs Dir) | directory to use for relative paths |
-> Unresolved a | |
-> m a |
Resolve all of the file paths in an Unresolved
relative to the given
directory.
Since: 0.1.0.0
Parsed tree with more information on the Haskell package it contains.
Since: 0.1.0.0
Constructors
Package | |
Fields
|
data PackageCabal Source #
Constructors
PCCabalFile !TreeEntry | TreeEntry of Cabal file |
PCHpack !PHpack |
Instances
Show PackageCabal Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> PackageCabal -> ShowS # show :: PackageCabal -> String # showList :: [PackageCabal] -> ShowS # | |
Eq PackageCabal Source # | |
Defined in Pantry.Types | |
Ord PackageCabal Source # | |
Defined in Pantry.Types Methods compare :: PackageCabal -> PackageCabal -> Ordering # (<) :: PackageCabal -> PackageCabal -> Bool # (<=) :: PackageCabal -> PackageCabal -> Bool # (>) :: PackageCabal -> PackageCabal -> Bool # (>=) :: PackageCabal -> PackageCabal -> Bool # max :: PackageCabal -> PackageCabal -> PackageCabal # min :: PackageCabal -> PackageCabal -> PackageCabal # |
Constructors
PHpack | |
Fields
|
data RawPackageLocation Source #
Location to load a package from. Can either be immutable (see
PackageLocationImmutable
) or a local directory which is expected to change
over time. Raw version doesn't include exact package version (e.g. could
refer to the latest revision on Hackage)
Since: 0.1.0.0
Constructors
RPLImmutable !RawPackageLocationImmutable | |
RPLMutable !(ResolvedPath Dir) |
Instances
data PackageLocation Source #
Location to load a package from. Can either be immutable (see
PackageLocationImmutable
) or a local directory which is expected to change
over time.
Since: 0.1.0.0
Constructors
PLImmutable !PackageLocationImmutable | |
PLMutable !(ResolvedPath Dir) |
Instances
toRawPL :: PackageLocation -> RawPackageLocation Source #
Convert PackageLocation
to its "raw" equivalent
Since: 0.1.0.0
data RawPackageLocationImmutable Source #
Location for remote packages or archives assumed to be immutable. as user specifies it i.e. not an exact location
Since: 0.1.0.0
Constructors
RPLIHackage !PackageIdentifierRevision !(Maybe TreeKey) | |
RPLIArchive !RawArchive !RawPackageMetadata | |
RPLIRepo !Repo !RawPackageMetadata |
Instances
data PackageLocationImmutable Source #
Location for remote packages or archives assumed to be immutable.
Since: 0.1.0.0
Constructors
PLIHackage !PackageIdentifier !BlobKey !TreeKey | |
PLIArchive !Archive !PackageMetadata | |
PLIRepo !Repo !PackageMetadata |
Instances
toRawPLI :: PackageLocationImmutable -> RawPackageLocationImmutable Source #
Convert PackageLocationImmutable
to its "raw" equivalent
Since: 0.1.0.0
data RawArchive Source #
A raw package archive, specified by a user, could have no hash and file size information.
Since: 0.1.0.0
Constructors
RawArchive | |
Fields
|
Instances
A package archive, could be from a URL or a local file path. Local file path archives are assumed to be unchanging over time, and so are allowed in custom snapshots.
Since: 0.1.0.0
Constructors
Archive | |
Fields
|
Instances
Generic Archive Source # | |
Show Archive Source # | |
NFData Archive Source # | |
Defined in Pantry.Types | |
Eq Archive Source # | |
Ord Archive Source # | |
type Rep Archive Source # | |
Defined in Pantry.Types type Rep Archive = D1 ('MetaData "Archive" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "Archive" 'PrefixI 'True) ((S1 ('MetaSel ('Just "archiveLocation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ArchiveLocation) :*: S1 ('MetaSel ('Just "archiveHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SHA256)) :*: (S1 ('MetaSel ('Just "archiveSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FileSize) :*: S1 ('MetaSel ('Just "archiveSubdir") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))) |
toRawArchive :: Archive -> RawArchive Source #
Convert archive to its "raw" equivalent.
Since: 0.1.0.0
Information on packages stored in a source control repository.
Since: 0.1.0.0
Constructors
Repo | |
Fields
|
Instances
Generic Repo Source # | |
Show Repo Source # | |
NFData Repo Source # | |
Defined in Pantry.Types | |
Eq Repo Source # | |
Ord Repo Source # | |
Display Repo Source # | |
Defined in Pantry.Types | |
type Rep Repo Source # | |
Defined in Pantry.Types type Rep Repo = D1 ('MetaData "Repo" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "Repo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "repoUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "repoCommit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "repoType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RepoType) :*: S1 ('MetaSel ('Just "repoSubdir") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))) |
data AggregateRepo Source #
Constructors
AggregateRepo | |
Fields
|
Instances
data SimpleRepo Source #
Repository without subdirectory information.
Since: 0.5.3
Constructors
SimpleRepo | |
Instances
toAggregateRepos :: [(Repo, RawPackageMetadata)] -> [AggregateRepo] Source #
Group input repositories by non-subdir values.
rToSimpleRepo :: Repo -> SimpleRepo Source #
The type of a source control repository.
Since: 0.1.0.0
Instances
Generic RepoType Source # | |
Show RepoType Source # | |
NFData RepoType Source # | |
Defined in Pantry.Types | |
Eq RepoType Source # | |
Ord RepoType Source # | |
Defined in Pantry.Types | |
PersistField RepoType Source # | |
Defined in Pantry.Types Methods toPersistValue :: RepoType -> PersistValue # | |
PersistFieldSql RepoType Source # | |
type Rep RepoType Source # | |
parsePackageIdentifier :: String -> Maybe PackageIdentifier Source #
This is almost a copy of Cabal's parser for package identifiers, the main difference is in the fact that Stack requires version to be present while Cabal uses "null version" as a default value
Since: 0.1.0.0
parsePackageName :: String -> Maybe PackageName Source #
Parse a package name from a Value
.
Since: 0.1.0.0
parsePackageNameThrowing :: MonadThrow m => String -> m PackageName Source #
Parse a package name from a Value
throwing on failure
Since: 0.1.0.0
parseVersionThrowing :: MonadThrow m => String -> m Version Source #
Parse a package version from a Value
throwing on failure
Since: 0.1.0.0
packageIdentifierString :: PackageIdentifier -> String Source #
Render a package identifier as a Value
.
Since: 0.1.0.0
packageNameString :: PackageName -> String Source #
Render a package name as a Value
.
Since: 0.1.0.0
moduleNameString :: ModuleName -> String Source #
Render a module name as a Value
.
Since: 0.1.0.0
data OptionalSubdirs Source #
Constructors
OSSubdirs !(NonEmpty Text) | |
OSPackageMetadata !Text !RawPackageMetadata | subdirectory and package metadata |
Instances
data ArchiveLocation Source #
Location that an archive is stored at
Since: 0.1.0.0
Constructors
ALUrl !Text | Archive stored at an HTTP(S) URL Since: 0.1.0.0 |
ALFilePath !(ResolvedPath File) | Archive stored at a local file path Since: 0.1.0.0 |
Instances
newtype RelFilePath Source #
File path relative to the configuration file it was parsed from
Since: 0.1.0.0
Constructors
RelFilePath Text |
Instances
newtype CabalString a Source #
Newtype wrapper for easier JSON integration with Cabal types.
Since: 0.1.0.0
Constructors
CabalString | |
Fields
|
Instances
toCabalStringMap :: Map a v -> Map (CabalString a) v Source #
Wrap the keys in a Map
with a CabalString
to get a ToJSON
instance.
Since: 0.1.0.0
unCabalStringMap :: Map (CabalString a) v -> Map a v Source #
Unwrap the CabalString
from the keys in a Map
to use a
FromJSON
instance.
Since: 0.1.0.0
parsePackageIdentifierRevision :: Text -> Either PantryException PackageIdentifierRevision Source #
Parse a PackageIdentifierRevision
Since: 0.1.0.0
Constructors
Mismatch | |
Fields
|
data PantryException Source #
Things that can go wrong in pantry. Note two things:
- Many other exception types may be thrown from underlying libraries. Pantry does not attempt to wrap these underlying exceptions.
- We may add more constructors to this data type in minor version bumps of pantry. This technically breaks the PVP. You should not be writing pattern matches against this type that expect total matching.
Since: 0.1.0.0
Constructors
Instances
Exception PantryException Source # | |
Defined in Pantry.Types Methods toException :: PantryException -> SomeException # | |
Show PantryException Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> PantryException -> ShowS # show :: PantryException -> String # showList :: [PantryException] -> ShowS # | |
Display PantryException Source # | |
Defined in Pantry.Types | |
Pretty PantryException Source # | |
Defined in Pantry.Types Methods pretty :: PantryException -> StyleDoc # |
data FuzzyResults Source #
data ResolvedPath t Source #
A combination of the relative path provided in a config file, together with the resolved absolute path.
Since: 0.1.0.0
Constructors
ResolvedPath | |
Fields
|
Instances
data HpackExecutable Source #
What to use for running hpack
Since: 0.1.0.0
Constructors
HpackBundled | Compiled in library |
HpackCommand !FilePath | Executable at the provided path |
Instances
Read HpackExecutable Source # | |
Defined in Pantry.Types Methods readsPrec :: Int -> ReadS HpackExecutable # readList :: ReadS [HpackExecutable] # | |
Show HpackExecutable Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> HpackExecutable -> ShowS # show :: HpackExecutable -> String # showList :: [HpackExecutable] -> ShowS # | |
Eq HpackExecutable Source # | |
Defined in Pantry.Types Methods (==) :: HpackExecutable -> HpackExecutable -> Bool # (/=) :: HpackExecutable -> HpackExecutable -> Bool # | |
Ord HpackExecutable Source # | |
Defined in Pantry.Types Methods compare :: HpackExecutable -> HpackExecutable -> Ordering # (<) :: HpackExecutable -> HpackExecutable -> Bool # (<=) :: HpackExecutable -> HpackExecutable -> Bool # (>) :: HpackExecutable -> HpackExecutable -> Bool # (>=) :: HpackExecutable -> HpackExecutable -> Bool # max :: HpackExecutable -> HpackExecutable -> HpackExecutable # min :: HpackExecutable -> HpackExecutable -> HpackExecutable # |
data WantedCompiler Source #
Which compiler a snapshot wants to use. The build tool may elect to do some fuzzy matching of versions (e.g., allowing different patch versions).
Since: 0.1.0.0
Constructors
WCGhc !Version | |
WCGhcGit !Text !Text | |
WCGhcjs !Version !Version | GHCJS version followed by GHC version |
Instances
snapshotLocation :: HasPantryConfig env => SnapName -> RIO env RawSnapshotLocation Source #
Get the location of a snapshot synonym from the PantryConfig
.
Since: 0.5.0.0
defaultSnapshotLocation :: SnapName -> RawSnapshotLocation Source #
Default location of snapshot synonyms, i.e. commercialhaskell's GitHub repository.
Since: 0.5.0.0
A snapshot synonym. It is expanded according to the field
snapshotLocation
of a PantryConfig
.
@ since 0.5.0.0
Constructors
LTS | |
Nightly !Day | Stackage Nightly snapshot, displayed as Since: 0.5.0.0 |
Instances
ToJSON SnapName Source # | |
Defined in Pantry.Types | |
Generic SnapName Source # | |
Show SnapName Source # | |
NFData SnapName Source # | |
Defined in Pantry.Types | |
Eq SnapName Source # | |
Ord SnapName Source # | |
Defined in Pantry.Types | |
Display SnapName Source # | |
Defined in Pantry.Types | |
type Rep SnapName Source # | |
Defined in Pantry.Types type Rep SnapName = D1 ('MetaData "SnapName" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "LTS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Nightly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Day))) |
parseSnapName :: MonadThrow m => Text -> m SnapName Source #
Parse the short representation of a SnapName
.
Since: 0.5.0.0
data RawSnapshotLocation Source #
Where to load a snapshot from in raw form (RSUrl could have a missing BlobKey)
Since: 0.1.0.0
Constructors
RSLCompiler !WantedCompiler | Don't use an actual snapshot, just a version of the compiler with its shipped packages. Since: 0.1.0.0 |
RSLUrl !Text !(Maybe BlobKey) | Download the snapshot from the given URL. The optional Since: 0.1.0.0 |
RSLFilePath !(ResolvedPath File) | Snapshot at a local file path. Since: 0.1.0.0 |
RSLSynonym !SnapName | Snapshot synonym (LTS/Nightly). Since: 0.5.0.0 |
Instances
data SnapshotLocation Source #
Where to load a snapshot from.
Since: 0.1.0.0
Constructors
SLCompiler !WantedCompiler | Don't use an actual snapshot, just a version of the compiler with its shipped packages. Since: 0.1.0.0 |
SLUrl !Text !BlobKey | Download the snapshot from the given URL. The optional
Since: 0.1.0.0 |
SLFilePath !(ResolvedPath File) | Snapshot at a local file path. Since: 0.1.0.0 |
Instances
toRawSL :: SnapshotLocation -> RawSnapshotLocation Source #
Convert snapshot location to its "raw" equivalent.
Since: 0.1.0.0
parseHackageText :: Text -> Either PantryException (PackageIdentifier, BlobKey) Source #
Parse a hackage text.
Since: 0.1.0.0
parseRawSnapshotLocation :: Text -> Unresolved RawSnapshotLocation Source #
Parse a Text
into an Unresolved
RawSnapshotLocation
.
Since: 0.1.0.0
data RawSnapshotLayer Source #
A single layer of a snapshot, i.e. a specific YAML configuration file.
Since: 0.1.0.0
Constructors
RawSnapshotLayer | |
Fields
|
Instances
data SnapshotLayer Source #
A single layer of a snapshot, i.e. a specific YAML configuration file.
Since: 0.1.0.0
Constructors
SnapshotLayer | |
Fields
|
Instances
toRawSnapshotLayer :: SnapshotLayer -> RawSnapshotLayer Source #
Convert snapshot layer into its "raw" equivalent.
Since: 0.1.0.0
data RawSnapshot Source #
A flattened representation of all the layers in a snapshot.
Since: 0.1.0.0
Constructors
RawSnapshot | |
Fields
|
A flattened representation of all the layers in a snapshot.
Since: 0.1.0.0
Constructors
Snapshot | |
Fields
|
data RawSnapshotPackage Source #
Settings for a package found in a snapshot.
Since: 0.1.0.0
Constructors
RawSnapshotPackage | |
Fields
|
data SnapshotPackage Source #
Settings for a package found in a snapshot.
Since: 0.1.0.0
Constructors
SnapshotPackage | |
Fields
|
Instances
Show SnapshotPackage Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> SnapshotPackage -> ShowS # show :: SnapshotPackage -> String # showList :: [SnapshotPackage] -> ShowS # |
parseWantedCompiler :: Text -> Either PantryException WantedCompiler Source #
Parse a Text
into a WantedCompiler
value.
Since: 0.1.0.0
data RawPackageMetadata Source #
Metadata provided by a config file for archives and repos. This information can be used for optimized lookups of information like package identifiers, or for validating that the user configuration has the expected information.
Since: 0.1.0.0
Constructors
RawPackageMetadata | |
Fields
|
Instances
data PackageMetadata Source #
Exact metadata specifying concrete package
Since: 0.1.0.0
Constructors
PackageMetadata | |
Fields
|
Instances
toRawPM :: PackageMetadata -> RawPackageMetadata Source #
Convert package metadata to its "raw" equivalent.
Since: 0.1.0.0
newtype SnapshotCacheHash Source #
An arbitrary hash for a snapshot, used for finding module names in a snapshot. Mostly intended for Stack's usage.
Since: 0.1.0.0
Constructors
SnapshotCacheHash | |
Fields |
Instances
Show SnapshotCacheHash Source # | |
Defined in Pantry.Types Methods showsPrec :: Int -> SnapshotCacheHash -> ShowS # show :: SnapshotCacheHash -> String # showList :: [SnapshotCacheHash] -> ShowS # |
getGlobalHintsFile :: HasPantryConfig env => RIO env (Path Abs File) Source #
Get the path to the global hints cache file
bsToBlobKey :: ByteString -> BlobKey Source #
Creates BlobKey for an input ByteString
Since: 0.1.0.0
warnMissingCabalFile :: HasLogFunc env => RawPackageLocationImmutable -> RIO env () Source #
Warn if the package uses PCHpack
.
Since: 0.4.0.0
connRDBMS :: SqlBackend -> Text #
A tag displaying what database the SqlBackend
is for. Can be
used to differentiate features in downstream libraries for different
database backends.