pantry-0.9.2: Content addressable Haskell package management
Safe HaskellSafe-Inferred
LanguageHaskell2010

Pantry

Description

Content addressable Haskell package management, providing for secure, reproducible acquisition of Haskell package contents and metadata.

Since: 0.1.0.0

Synopsis

Running

data PantryConfig #

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

data PackageIndexConfig #

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

Instances

Instances details
Show PackageIndexConfig 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings PackageIndexConfig)

If the hackage-security key is absent from the JSON object, assigns default value defaultHackageSecurityConfig.

Since: 0.6.0

Instance details

Defined in Pantry.Types

data HackageSecurityConfig #

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

Instances

Instances details
Show HackageSecurityConfig 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings HackageSecurityConfig)

If the ignore-expiry key is absent from the JSON object, assigns default value True.

Since: 0.1.1.0

Instance details

Defined in Pantry.Types

defaultPackageIndexConfig :: PackageIndexConfig Source #

Default PackageIndexConfig value using the official Hackage server.

Since: 0.6.0

defaultDownloadPrefix :: Text Source #

The download prefix for the official Hackage server.

Since: 0.6.0

defaultHackageSecurityConfig :: HackageSecurityConfig #

Default HackageSecurityConfig value using the official Hackage server. The value of the hscIgnoreExpiry field is True.

Since: 0.7.0

defaultCasaRepoPrefix :: CasaRepoPrefix Source #

Default pull URL for Casa.

Since: 0.1.1.1

defaultCasaMaxPerRequest :: Int Source #

Default max keys to pull per request.

Since: 0.1.1.1

defaultSnapshotLocation :: SnapName -> RawSnapshotLocation #

Default location of snapshot synonyms, i.e. commercialhaskell's GitHub repository.

Since: 0.5.0.0

class HasPantryConfig env where #

An environment which contains a PantryConfig.

Since: 0.1.0.0

Methods

pantryConfigL :: Lens' env PantryConfig #

Lens to get or set the PantryConfig

Since: 0.1.0.0

Instances

Instances details
HasPantryConfig PantryApp Source # 
Instance details

Defined in Pantry

withPantryConfig Source #

Arguments

:: HasLogFunc env 
=> Path Abs Dir

pantry root directory, where the SQLite database and Hackage downloads are kept.

-> PackageIndexConfig

Package index configuration. You probably want defaultPackageIndexConfig.

-> HpackExecutable

When converting an hpack package.yaml file to a cabal file, what version of hpack should we use?

-> Int

Maximum connection count

-> CasaRepoPrefix

The casa pull URL e.g. https://casa.stackage.org/v1/pull.

-> Int

Max casa keys to pull per request.

-> (SnapName -> RawSnapshotLocation)

The location of snapshot synonyms

-> (PantryConfig -> RIO env a)

What to do with the config

-> RIO env a 

Create a new PantryConfig with the given settings. For a version where the use of Casa (content-addressable storage archive) is optional, see withPantryConfig'.

For something easier to use in simple cases, see runPantryApp.

Since: 0.1.0.0

withPantryConfig' Source #

Arguments

:: HasLogFunc env 
=> Path Abs Dir

pantry root directory, where the SQLite database and Hackage downloads are kept.

-> PackageIndexConfig

Package index configuration. You probably want defaultPackageIndexConfig.

-> HpackExecutable

When converting an hpack package.yaml file to a cabal file, what version of hpack should we use?

-> Int

Maximum connection count

-> Maybe (CasaRepoPrefix, Int)

Optionally, the Casa pull URL e.g. https://casa.fpcomplete.com and the maximum number of Casa keys to pull per request.

-> (SnapName -> RawSnapshotLocation)

The location of snapshot synonyms

-> (PantryConfig -> RIO env a)

What to do with the config

-> RIO env a 

Create a new PantryConfig with the given settings.

For something easier to use in simple cases, see runPantryApp.

Since: 0.8.3

Convenience

data PantryApp Source #

Convenient data type that allows you to work with pantry more easily than using withPantryConfig or withPantryConfig' directly. Uses basically sane settings, like sharing a pantry directory with Stack.

You can use runPantryApp to use this.

Since: 0.1.0.0

Instances

Instances details
HasPantryConfig PantryApp Source # 
Instance details

Defined in Pantry

HasLogFunc PantryApp Source # 
Instance details

Defined in Pantry

HasProcessContext PantryApp Source # 
Instance details

Defined in Pantry

HasTerm PantryApp Source # 
Instance details

Defined in Pantry

HasStylesUpdate PantryApp Source # 
Instance details

Defined in Pantry

runPantryApp :: MonadIO m => RIO PantryApp a -> m a Source #

Run some code against pantry using basic sane settings.

For testing, see runPantryAppClean.

Since: 0.1.0.0

runPantryAppClean :: MonadIO m => RIO PantryApp a -> m a Source #

Like runPantryApp, but uses an empty pantry directory instead of sharing with Stack. Useful for testing.

Since: 0.1.0.0

runPantryAppWith :: MonadIO m => Int -> CasaRepoPrefix -> Int -> RIO PantryApp a -> m a Source #

Run some code against pantry using basic sane settings.

For testing, see runPantryAppClean.

Since: 0.1.1.1

hpackExecutableL :: Lens' PantryConfig HpackExecutable Source #

Lens to view or modify the HpackExecutable of a PantryConfig

Since: 0.1.0.0

Types

Exceptions

data PantryException #

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

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)

Different from DownloadInvalidSize since mismatchActual is a lower bound on the size from the server.

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 Mismatch a #

Constructors

Mismatch 

Fields

Cabal types

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

Instances details
Parsec PackageName 
Instance details

Defined in Distribution.Types.PackageName

Methods

parsec :: CabalParsing m => m PackageName #

Pretty PackageName 
Instance details

Defined in Distribution.Types.PackageName

Structured PackageName 
Instance details

Defined in Distribution.Types.PackageName

Data PackageName 
Instance details

Defined in Distribution.Types.PackageName

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageName -> c PackageName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageName #

toConstr :: PackageName -> Constr #

dataTypeOf :: PackageName -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PackageName) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageName) #

gmapT :: (forall b. Data b => b -> b) -> PackageName -> PackageName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageName -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageName -> r #

gmapQ :: (forall d. Data d => d -> u) -> PackageName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageName -> m PackageName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageName -> m PackageName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageName -> m PackageName #

IsString PackageName

mkPackageName

Since: Cabal-2.0.0.2

Instance details

Defined in Distribution.Types.PackageName

Generic PackageName 
Instance details

Defined in Distribution.Types.PackageName

Associated Types

type Rep PackageName :: Type -> Type #

Read PackageName 
Instance details

Defined in Distribution.Types.PackageName

Show PackageName 
Instance details

Defined in Distribution.Types.PackageName

Binary PackageName 
Instance details

Defined in Distribution.Types.PackageName

NFData PackageName 
Instance details

Defined in Distribution.Types.PackageName

Methods

rnf :: PackageName -> () #

Eq PackageName 
Instance details

Defined in Distribution.Types.PackageName

Ord PackageName 
Instance details

Defined in Distribution.Types.PackageName

IsCabalString PackageName 
Instance details

Defined in Pantry.Types

type Rep PackageName 
Instance details

Defined in Distribution.Types.PackageName

type Rep PackageName = D1 ('MetaData "PackageName" "Distribution.Types.PackageName" "Cabal-3.6.3.0" 'True) (C1 ('MetaCons "PackageName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))

data Version #

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

Instances details
Parsec Version 
Instance details

Defined in Distribution.Types.Version

Methods

parsec :: CabalParsing m => m Version #

Pretty Version 
Instance details

Defined in Distribution.Types.Version

Structured Version 
Instance details

Defined in Distribution.Types.Version

Data Version 
Instance details

Defined in Distribution.Types.Version

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version #

toConstr :: Version -> Constr #

dataTypeOf :: Version -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) #

gmapT :: (forall b. Data b => b -> b) -> Version -> Version #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r #

gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version #

Generic Version 
Instance details

Defined in Distribution.Types.Version

Associated Types

type Rep Version :: Type -> Type #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Read Version 
Instance details

Defined in Distribution.Types.Version

Show Version 
Instance details

Defined in Distribution.Types.Version

Binary Version 
Instance details

Defined in Distribution.Types.Version

Methods

put :: Version -> Put #

get :: Get Version #

putList :: [Version] -> Put #

NFData Version 
Instance details

Defined in Distribution.Types.Version

Methods

rnf :: Version -> () #

Eq Version 
Instance details

Defined in Distribution.Types.Version

Methods

(==) :: Version -> Version -> Bool #

(/=) :: Version -> Version -> Bool #

Ord Version 
Instance details

Defined in Distribution.Types.Version

IsCabalString Version 
Instance details

Defined in Pantry.Types

type Rep Version 
Instance details

Defined in Distribution.Types.Version

data FlagName #

A FlagName is the name of a user-defined configuration flag

Use mkFlagName and unFlagName to convert from/to a String.

This type is opaque since Cabal-2.0

Since: Cabal-2.0.0.2

Instances

Instances details
Parsec FlagName 
Instance details

Defined in Distribution.Types.Flag

Methods

parsec :: CabalParsing m => m FlagName #

Pretty FlagName 
Instance details

Defined in Distribution.Types.Flag

Structured FlagName 
Instance details

Defined in Distribution.Types.Flag

Data FlagName 
Instance details

Defined in Distribution.Types.Flag

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FlagName -> c FlagName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FlagName #

toConstr :: FlagName -> Constr #

dataTypeOf :: FlagName -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FlagName) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FlagName) #

gmapT :: (forall b. Data b => b -> b) -> FlagName -> FlagName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FlagName -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FlagName -> r #

gmapQ :: (forall d. Data d => d -> u) -> FlagName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FlagName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FlagName -> m FlagName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FlagName -> m FlagName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FlagName -> m FlagName #

IsString FlagName

mkFlagName

Since: Cabal-2.0.0.2

Instance details

Defined in Distribution.Types.Flag

Generic FlagName 
Instance details

Defined in Distribution.Types.Flag

Associated Types

type Rep FlagName :: Type -> Type #

Methods

from :: FlagName -> Rep FlagName x #

to :: Rep FlagName x -> FlagName #

Read FlagName 
Instance details

Defined in Distribution.Types.Flag

Show FlagName 
Instance details

Defined in Distribution.Types.Flag

Binary FlagName 
Instance details

Defined in Distribution.Types.Flag

Methods

put :: FlagName -> Put #

get :: Get FlagName #

putList :: [FlagName] -> Put #

NFData FlagName 
Instance details

Defined in Distribution.Types.Flag

Methods

rnf :: FlagName -> () #

Eq FlagName 
Instance details

Defined in Distribution.Types.Flag

Ord FlagName 
Instance details

Defined in Distribution.Types.Flag

IsCabalString FlagName 
Instance details

Defined in Pantry.Types

type Rep FlagName 
Instance details

Defined in Distribution.Types.Flag

type Rep FlagName = D1 ('MetaData "FlagName" "Distribution.Types.Flag" "Cabal-3.6.3.0" 'True) (C1 ('MetaCons "FlagName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortText)))

data PackageIdentifier #

The name and version of a package.

Constructors

PackageIdentifier 

Fields

Instances

Instances details
Parsec PackageIdentifier
>>> simpleParsec "foo-bar-0" :: Maybe PackageIdentifier
Just (PackageIdentifier {pkgName = PackageName "foo-bar", pkgVersion = mkVersion [0]})
>>> simpleParsec "foo-bar" :: Maybe PackageIdentifier
Just (PackageIdentifier {pkgName = PackageName "foo-bar", pkgVersion = mkVersion []})

Note: Stricter than Text instance

>>> simpleParsec "foo-bar-0-0" :: Maybe PackageIdentifier
Nothing
>>> simpleParsec "foo-bar.0" :: Maybe PackageIdentifier
Nothing
>>> simpleParsec "foo-bar.4-2" :: Maybe PackageIdentifier
Nothing
>>> simpleParsec "1.2.3" :: Maybe PackageIdentifier
Nothing
Instance details

Defined in Distribution.Types.PackageId

Pretty PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Structured PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Data PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageIdentifier -> c PackageIdentifier #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageIdentifier #

toConstr :: PackageIdentifier -> Constr #

dataTypeOf :: PackageIdentifier -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PackageIdentifier) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageIdentifier) #

gmapT :: (forall b. Data b => b -> b) -> PackageIdentifier -> PackageIdentifier #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageIdentifier -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageIdentifier -> r #

gmapQ :: (forall d. Data d => d -> u) -> PackageIdentifier -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageIdentifier -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageIdentifier -> m PackageIdentifier #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageIdentifier -> m PackageIdentifier #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageIdentifier -> m PackageIdentifier #

Generic PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Associated Types

type Rep PackageIdentifier :: Type -> Type #

Read PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Show PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Binary PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

NFData PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Methods

rnf :: PackageIdentifier -> () #

Eq PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

Ord PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

IsCabalString PackageIdentifier 
Instance details

Defined in Pantry.Types

type Rep PackageIdentifier 
Instance details

Defined in Distribution.Types.PackageId

type Rep PackageIdentifier = D1 ('MetaData "PackageIdentifier" "Distribution.Types.PackageId" "Cabal-3.6.3.0" 'False) (C1 ('MetaCons "PackageIdentifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "pkgName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Just "pkgVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version)))

Files

newtype FileSize #

File size in bytes

Since: 0.1.0.0

Constructors

FileSize Word 

Instances

Instances details
FromJSON FileSize 
Instance details

Defined in Pantry.Types

ToJSON FileSize 
Instance details

Defined in Pantry.Types

Generic FileSize 
Instance details

Defined in Pantry.Types

Associated Types

type Rep FileSize :: Type -> Type #

Methods

from :: FileSize -> Rep FileSize x #

to :: Rep FileSize x -> FileSize #

Show FileSize 
Instance details

Defined in Pantry.Types

NFData FileSize 
Instance details

Defined in Pantry.Types

Methods

rnf :: FileSize -> () #

Eq FileSize 
Instance details

Defined in Pantry.Types

Ord FileSize 
Instance details

Defined in Pantry.Types

Hashable FileSize 
Instance details

Defined in Pantry.Types

Methods

hashWithSalt :: Int -> FileSize -> Int #

hash :: FileSize -> Int #

PersistField FileSize 
Instance details

Defined in Pantry.Types

PersistFieldSql FileSize 
Instance details

Defined in Pantry.Types

Display FileSize 
Instance details

Defined in Pantry.Types

type Rep FileSize 
Instance details

Defined in Pantry.Types

type Rep FileSize = D1 ('MetaData "FileSize" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'True) (C1 ('MetaCons "FileSize" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word)))

newtype RelFilePath #

File path relative to the configuration file it was parsed from

Since: 0.1.0.0

Constructors

RelFilePath Text 

Instances

Instances details
FromJSON RelFilePath 
Instance details

Defined in Pantry.Types

ToJSON RelFilePath 
Instance details

Defined in Pantry.Types

Generic RelFilePath 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RelFilePath :: Type -> Type #

Show RelFilePath 
Instance details

Defined in Pantry.Types

NFData RelFilePath 
Instance details

Defined in Pantry.Types

Methods

rnf :: RelFilePath -> () #

Eq RelFilePath 
Instance details

Defined in Pantry.Types

Ord RelFilePath 
Instance details

Defined in Pantry.Types

Display RelFilePath 
Instance details

Defined in Pantry.Types

type Rep RelFilePath 
Instance details

Defined in Pantry.Types

type Rep RelFilePath = D1 ('MetaData "RelFilePath" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'True) (C1 ('MetaCons "RelFilePath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data ResolvedPath t #

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

Instances details
Generic (ResolvedPath t) 
Instance details

Defined in Pantry.Types

Associated Types

type Rep (ResolvedPath t) :: Type -> Type #

Methods

from :: ResolvedPath t -> Rep (ResolvedPath t) x #

to :: Rep (ResolvedPath t) x -> ResolvedPath t #

Show (ResolvedPath t) 
Instance details

Defined in Pantry.Types

NFData (ResolvedPath t) 
Instance details

Defined in Pantry.Types

Methods

rnf :: ResolvedPath t -> () #

Eq (ResolvedPath t) 
Instance details

Defined in Pantry.Types

Ord (ResolvedPath t) 
Instance details

Defined in Pantry.Types

type Rep (ResolvedPath t) 
Instance details

Defined in Pantry.Types

type Rep (ResolvedPath t) = D1 ('MetaData "ResolvedPath" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "ResolvedPath" 'PrefixI 'True) (S1 ('MetaSel ('Just "resolvedRelative") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RelFilePath) :*: S1 ('MetaSel ('Just "resolvedAbsolute") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Path Abs t))))

data Unresolved a #

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

Instances details
Applicative Unresolved 
Instance details

Defined in Pantry.Types

Methods

pure :: a -> Unresolved a #

(<*>) :: Unresolved (a -> b) -> Unresolved a -> Unresolved b #

liftA2 :: (a -> b -> c) -> Unresolved a -> Unresolved b -> Unresolved c #

(*>) :: Unresolved a -> Unresolved b -> Unresolved b #

(<*) :: Unresolved a -> Unresolved b -> Unresolved a #

Functor Unresolved 
Instance details

Defined in Pantry.Types

Methods

fmap :: (a -> b) -> Unresolved a -> Unresolved b #

(<$) :: a -> Unresolved b -> Unresolved a #

FromJSON (WithJSONWarnings (Unresolved PackageLocationImmutable)) 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved RawSnapshotLayer)) 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved RawSnapshotLocation)) 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved SnapshotLocation)) 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved (NonEmpty RawPackageLocation))) 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved (NonEmpty RawPackageLocationImmutable))) 
Instance details

Defined in Pantry.Types

Cryptography

data SHA256 #

A SHA256 hash, stored in a static size for more efficient memory representation.

Since: 0.1.0.0

Instances

Instances details
FromJSON SHA256 
Instance details

Defined in Pantry.SHA256

ToJSON SHA256 
Instance details

Defined in Pantry.SHA256

Data SHA256 
Instance details

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 
Instance details

Defined in Pantry.SHA256

Associated Types

type Rep SHA256 :: Type -> Type #

Methods

from :: SHA256 -> Rep SHA256 x #

to :: Rep SHA256 x -> SHA256 #

Show SHA256 
Instance details

Defined in Pantry.SHA256

NFData SHA256 
Instance details

Defined in Pantry.SHA256

Methods

rnf :: SHA256 -> () #

Eq SHA256 
Instance details

Defined in Pantry.SHA256

Methods

(==) :: SHA256 -> SHA256 -> Bool #

(/=) :: SHA256 -> SHA256 -> Bool #

Ord SHA256 
Instance details

Defined in Pantry.SHA256

Hashable SHA256 
Instance details

Defined in Pantry.SHA256

Methods

hashWithSalt :: Int -> SHA256 -> Int #

hash :: SHA256 -> Int #

PersistField SHA256 
Instance details

Defined in Pantry.SHA256

PersistFieldSql SHA256 
Instance details

Defined in Pantry.SHA256

Display SHA256 
Instance details

Defined in Pantry.SHA256

type Rep SHA256 
Instance details

Defined in Pantry.SHA256

type Rep SHA256 = D1 ('MetaData "SHA256" "Pantry.SHA256" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'True) (C1 ('MetaCons "SHA256" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bytes32)))

newtype TreeKey #

The hash of the binary representation of a Tree.

Since: 0.1.0.0

Constructors

TreeKey BlobKey 

Instances

Instances details
FromJSON TreeKey 
Instance details

Defined in Pantry.Types

ToJSON TreeKey 
Instance details

Defined in Pantry.Types

Generic TreeKey 
Instance details

Defined in Pantry.Types

Associated Types

type Rep TreeKey :: Type -> Type #

Methods

from :: TreeKey -> Rep TreeKey x #

to :: Rep TreeKey x -> TreeKey #

Show TreeKey 
Instance details

Defined in Pantry.Types

NFData TreeKey 
Instance details

Defined in Pantry.Types

Methods

rnf :: TreeKey -> () #

Eq TreeKey 
Instance details

Defined in Pantry.Types

Methods

(==) :: TreeKey -> TreeKey -> Bool #

(/=) :: TreeKey -> TreeKey -> Bool #

Ord TreeKey 
Instance details

Defined in Pantry.Types

Display TreeKey 
Instance details

Defined in Pantry.Types

type Rep TreeKey 
Instance details

Defined in Pantry.Types

type Rep TreeKey = D1 ('MetaData "TreeKey" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'True) (C1 ('MetaCons "TreeKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlobKey)))

data BlobKey #

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

Constructors

BlobKey !SHA256 !FileSize 

Instances

Instances details
FromJSON BlobKey 
Instance details

Defined in Pantry.Types

ToJSON BlobKey 
Instance details

Defined in Pantry.Types

Generic BlobKey 
Instance details

Defined in Pantry.Types

Associated Types

type Rep BlobKey :: Type -> Type #

Methods

from :: BlobKey -> Rep BlobKey x #

to :: Rep BlobKey x -> BlobKey #

Show BlobKey 
Instance details

Defined in Pantry.Types

NFData BlobKey 
Instance details

Defined in Pantry.Types

Methods

rnf :: BlobKey -> () #

Eq BlobKey 
Instance details

Defined in Pantry.Types

Methods

(==) :: BlobKey -> BlobKey -> Bool #

(/=) :: BlobKey -> BlobKey -> Bool #

Ord BlobKey 
Instance details

Defined in Pantry.Types

Display BlobKey 
Instance details

Defined in Pantry.Types

type Rep BlobKey 
Instance details

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)))

Packages

data RawPackageMetadata #

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

Instances details
Generic RawPackageMetadata 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RawPackageMetadata :: Type -> Type #

Show RawPackageMetadata 
Instance details

Defined in Pantry.Types

NFData RawPackageMetadata 
Instance details

Defined in Pantry.Types

Methods

rnf :: RawPackageMetadata -> () #

Eq RawPackageMetadata 
Instance details

Defined in Pantry.Types

Ord RawPackageMetadata 
Instance details

Defined in Pantry.Types

Display RawPackageMetadata 
Instance details

Defined in Pantry.Types

type Rep RawPackageMetadata 
Instance details

Defined in Pantry.Types

type Rep RawPackageMetadata = D1 ('MetaData "RawPackageMetadata" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "RawPackageMetadata" 'PrefixI 'True) (S1 ('MetaSel ('Just "rpmName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe PackageName)) :*: (S1 ('MetaSel ('Just "rpmVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Version)) :*: S1 ('MetaSel ('Just "rpmTreeKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe TreeKey)))))

data PackageMetadata #

Exact metadata specifying concrete package

Since: 0.1.0.0

Constructors

PackageMetadata 

Fields

Instances

Instances details
Generic PackageMetadata 
Instance details

Defined in Pantry.Types

Associated Types

type Rep PackageMetadata :: Type -> Type #

Show PackageMetadata 
Instance details

Defined in Pantry.Types

NFData PackageMetadata 
Instance details

Defined in Pantry.Types

Methods

rnf :: PackageMetadata -> () #

Eq PackageMetadata 
Instance details

Defined in Pantry.Types

Ord PackageMetadata 
Instance details

Defined in Pantry.Types

Display PackageMetadata 
Instance details

Defined in Pantry.Types

type Rep PackageMetadata 
Instance details

Defined in Pantry.Types

type Rep PackageMetadata = D1 ('MetaData "PackageMetadata" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "PackageMetadata" 'PrefixI 'True) (S1 ('MetaSel ('Just "pmIdent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PackageIdentifier) :*: S1 ('MetaSel ('Just "pmTreeKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TreeKey)))

data Package #

Parsed tree with more information on the Haskell package it contains.

Since: 0.1.0.0

Constructors

Package 

Fields

Instances

Instances details
Show Package 
Instance details

Defined in Pantry.Types

Eq Package 
Instance details

Defined in Pantry.Types

Methods

(==) :: Package -> Package -> Bool #

(/=) :: Package -> Package -> Bool #

Ord Package 
Instance details

Defined in Pantry.Types

Hackage

data CabalFileInfo #

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 Maybe on FileSize is for compatibility with input that doesn't include the file size.

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. CFIHash should be preferred wherever possible for reproducibility.

Since: 0.1.0.0

Instances

Instances details
Generic CabalFileInfo 
Instance details

Defined in Pantry.Types

Associated Types

type Rep CabalFileInfo :: Type -> Type #

Show CabalFileInfo 
Instance details

Defined in Pantry.Types

NFData CabalFileInfo 
Instance details

Defined in Pantry.Types

Methods

rnf :: CabalFileInfo -> () #

Eq CabalFileInfo 
Instance details

Defined in Pantry.Types

Ord CabalFileInfo 
Instance details

Defined in Pantry.Types

Hashable CabalFileInfo 
Instance details

Defined in Pantry.Types

Display CabalFileInfo 
Instance details

Defined in Pantry.Types

type Rep CabalFileInfo 
Instance details

Defined in Pantry.Types

type Rep CabalFileInfo = D1 ('MetaData "CabalFileInfo" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "CFILatest" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CFIHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SHA256) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe FileSize))) :+: C1 ('MetaCons "CFIRevision" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Revision))))

newtype Revision #

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

Constructors

Revision Word 

Instances

Instances details
Data Revision 
Instance details

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 
Instance details

Defined in Pantry.Types

Associated Types

type Rep Revision :: Type -> Type #

Methods

from :: Revision -> Rep Revision x #

to :: Rep Revision x -> Revision #

Show Revision 
Instance details

Defined in Pantry.Types

NFData Revision 
Instance details

Defined in Pantry.Types

Methods

rnf :: Revision -> () #

Eq Revision 
Instance details

Defined in Pantry.Types

Ord Revision 
Instance details

Defined in Pantry.Types

Hashable Revision 
Instance details

Defined in Pantry.Types

Methods

hashWithSalt :: Int -> Revision -> Int #

hash :: Revision -> Int #

PersistField Revision 
Instance details

Defined in Pantry.Types

PersistFieldSql Revision 
Instance details

Defined in Pantry.Types

Display Revision 
Instance details

Defined in Pantry.Types

type Rep Revision 
Instance details

Defined in Pantry.Types

type Rep Revision = D1 ('MetaData "Revision" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'True) (C1 ('MetaCons "Revision" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word)))

data PackageIdentifierRevision #

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

Instances

Instances details
FromJSON PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

ToJSON PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

Generic PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

Associated Types

type Rep PackageIdentifierRevision :: Type -> Type #

Show PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

NFData PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

Eq PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

Ord PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

Display PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

type Rep PackageIdentifierRevision 
Instance details

Defined in Pantry.Types

type Rep PackageIdentifierRevision = D1 ('MetaData "PackageIdentifierRevision" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "PackageIdentifierRevision" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PackageName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Version) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CabalFileInfo))))

data UsePreferredVersions Source #

Should we pay attention to Hackage's preferred versions?

Since: 0.1.0.0

Instances

Instances details
Show UsePreferredVersions Source # 
Instance details

Defined in Pantry.Hackage

Archives

data RawArchive #

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

Instances details
Generic RawArchive 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RawArchive :: Type -> Type #

Show RawArchive 
Instance details

Defined in Pantry.Types

NFData RawArchive 
Instance details

Defined in Pantry.Types

Methods

rnf :: RawArchive -> () #

Eq RawArchive 
Instance details

Defined in Pantry.Types

Ord RawArchive 
Instance details

Defined in Pantry.Types

type Rep RawArchive 
Instance details

Defined in Pantry.Types

type Rep RawArchive = D1 ('MetaData "RawArchive" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "RawArchive" 'PrefixI 'True) ((S1 ('MetaSel ('Just "raLocation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ArchiveLocation) :*: S1 ('MetaSel ('Just "raHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe SHA256))) :*: (S1 ('MetaSel ('Just "raSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe FileSize)) :*: S1 ('MetaSel ('Just "raSubdir") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))))

data Archive #

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

Instances details
Generic Archive 
Instance details

Defined in Pantry.Types

Associated Types

type Rep Archive :: Type -> Type #

Methods

from :: Archive -> Rep Archive x #

to :: Rep Archive x -> Archive #

Show Archive 
Instance details

Defined in Pantry.Types

NFData Archive 
Instance details

Defined in Pantry.Types

Methods

rnf :: Archive -> () #

Eq Archive 
Instance details

Defined in Pantry.Types

Methods

(==) :: Archive -> Archive -> Bool #

(/=) :: Archive -> Archive -> Bool #

Ord Archive 
Instance details

Defined in Pantry.Types

type Rep Archive 
Instance details

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))))

data ArchiveLocation #

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

Instances details
Generic ArchiveLocation 
Instance details

Defined in Pantry.Types

Associated Types

type Rep ArchiveLocation :: Type -> Type #

Show ArchiveLocation 
Instance details

Defined in Pantry.Types

NFData ArchiveLocation 
Instance details

Defined in Pantry.Types

Methods

rnf :: ArchiveLocation -> () #

Eq ArchiveLocation 
Instance details

Defined in Pantry.Types

Ord ArchiveLocation 
Instance details

Defined in Pantry.Types

Display ArchiveLocation 
Instance details

Defined in Pantry.Types

Pretty ArchiveLocation 
Instance details

Defined in Pantry.Types

type Rep ArchiveLocation 
Instance details

Defined in Pantry.Types

type Rep ArchiveLocation = D1 ('MetaData "ArchiveLocation" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "ALUrl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "ALFilePath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResolvedPath File))))

Repos

data Repo #

Information on packages stored in a source control repository.

Since: 0.1.0.0

Constructors

Repo 

Fields

  • repoUrl :: !Text

    Location of the repo

    Since: 0.1.0.0

  • repoCommit :: !Text

    Commit to use from the repo. It's strongly recommended to use a hash instead of a tag or branch name.

    Since: 0.1.0.0

  • repoType :: !RepoType

    The type of the repo

    Since: 0.1.0.0

  • repoSubdir :: !Text

    Subdirectory within the archive to get the package from.

    Since: 0.1.0.0

Instances

Instances details
Generic Repo 
Instance details

Defined in Pantry.Types

Associated Types

type Rep Repo :: Type -> Type #

Methods

from :: Repo -> Rep Repo x #

to :: Rep Repo x -> Repo #

Show Repo 
Instance details

Defined in Pantry.Types

Methods

showsPrec :: Int -> Repo -> ShowS #

show :: Repo -> String #

showList :: [Repo] -> ShowS #

NFData Repo 
Instance details

Defined in Pantry.Types

Methods

rnf :: Repo -> () #

Eq Repo 
Instance details

Defined in Pantry.Types

Methods

(==) :: Repo -> Repo -> Bool #

(/=) :: Repo -> Repo -> Bool #

Ord Repo 
Instance details

Defined in Pantry.Types

Methods

compare :: Repo -> Repo -> Ordering #

(<) :: Repo -> Repo -> Bool #

(<=) :: Repo -> Repo -> Bool #

(>) :: Repo -> Repo -> Bool #

(>=) :: Repo -> Repo -> Bool #

max :: Repo -> Repo -> Repo #

min :: Repo -> Repo -> Repo #

Display Repo 
Instance details

Defined in Pantry.Types

type Rep Repo 
Instance details

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 RepoType #

The type of a source control repository.

Since: 0.1.0.0

Constructors

RepoGit 
RepoHg 

Instances

Instances details
Generic RepoType 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RepoType :: Type -> Type #

Methods

from :: RepoType -> Rep RepoType x #

to :: Rep RepoType x -> RepoType #

Show RepoType 
Instance details

Defined in Pantry.Types

NFData RepoType 
Instance details

Defined in Pantry.Types

Methods

rnf :: RepoType -> () #

Eq RepoType 
Instance details

Defined in Pantry.Types

Ord RepoType 
Instance details

Defined in Pantry.Types

PersistField RepoType 
Instance details

Defined in Pantry.Types

PersistFieldSql RepoType 
Instance details

Defined in Pantry.Types

type Rep RepoType 
Instance details

Defined in Pantry.Types

type Rep RepoType = D1 ('MetaData "RepoType" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "RepoGit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RepoHg" 'PrefixI 'False) (U1 :: Type -> Type))

data SimpleRepo #

Repository without subdirectory information.

Since: 0.5.3

Constructors

SimpleRepo 

Instances

Instances details
Generic SimpleRepo 
Instance details

Defined in Pantry.Types

Associated Types

type Rep SimpleRepo :: Type -> Type #

Show SimpleRepo 
Instance details

Defined in Pantry.Types

Eq SimpleRepo 
Instance details

Defined in Pantry.Types

Ord SimpleRepo 
Instance details

Defined in Pantry.Types

Display SimpleRepo 
Instance details

Defined in Pantry.Types

type Rep SimpleRepo 
Instance details

Defined in Pantry.Types

type Rep SimpleRepo = D1 ('MetaData "SimpleRepo" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "SimpleRepo" 'PrefixI 'True) (S1 ('MetaSel ('Just "sRepoUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "sRepoCommit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "sRepoType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RepoType))))

withRepo :: forall env a. (HasLogFunc env, HasProcessContext env) => SimpleRepo -> RIO env a -> RIO env a Source #

Clone the repository (and, in the case of Git and if necessary, fetch the specific commit) and execute the action with the working directory set to the repository root.

Since: 0.1.0.0

fetchRepos :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => [(Repo, PackageMetadata)] -> RIO env () Source #

Fetch the given repositories at once and populate the pantry database.

Since: 0.5.3

fetchReposRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => [(Repo, RawPackageMetadata)] -> RIO env () Source #

Like fetchRepos, except with RawPackageMetadata instead of PackageMetadata.

Since: 0.5.3

Package location

data RawPackageLocation #

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

Instances

Instances details
ToJSON RawPackageLocation 
Instance details

Defined in Pantry.Types

Generic RawPackageLocation 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RawPackageLocation :: Type -> Type #

Show RawPackageLocation 
Instance details

Defined in Pantry.Types

NFData RawPackageLocation 
Instance details

Defined in Pantry.Types

Methods

rnf :: RawPackageLocation -> () #

Eq RawPackageLocation 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved (NonEmpty RawPackageLocation))) 
Instance details

Defined in Pantry.Types

type Rep RawPackageLocation 
Instance details

Defined in Pantry.Types

type Rep RawPackageLocation = D1 ('MetaData "RawPackageLocation" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "RPLImmutable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RawPackageLocationImmutable)) :+: C1 ('MetaCons "RPLMutable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResolvedPath Dir))))

data PackageLocation #

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

Instances

Instances details
Generic PackageLocation 
Instance details

Defined in Pantry.Types

Associated Types

type Rep PackageLocation :: Type -> Type #

Show PackageLocation 
Instance details

Defined in Pantry.Types

NFData PackageLocation 
Instance details

Defined in Pantry.Types

Methods

rnf :: PackageLocation -> () #

Eq PackageLocation 
Instance details

Defined in Pantry.Types

Display PackageLocation 
Instance details

Defined in Pantry.Types

type Rep PackageLocation 
Instance details

Defined in Pantry.Types

type Rep PackageLocation = D1 ('MetaData "PackageLocation" "Pantry.Types" "pantry-0.9.2-BO58ByD0Ow6LRhpEn4nfNM-internal" 'False) (C1 ('MetaCons "PLImmutable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PackageLocationImmutable)) :+: C1 ('MetaCons "PLMutable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResolvedPath Dir))))

toRawPL :: PackageLocation -> RawPackageLocation #

Convert PackageLocation to its "raw" equivalent

Since: 0.1.0.0

data RawPackageLocationImmutable #

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

Instances

Instances details
ToJSON RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

Generic RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RawPackageLocationImmutable :: Type -> Type #

Show RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

NFData RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

Eq RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

Ord RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

Display RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

Pretty RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved (NonEmpty RawPackageLocationImmutable))) 
Instance details

Defined in Pantry.Types

type Rep RawPackageLocationImmutable 
Instance details

Defined in Pantry.Types

data PackageLocationImmutable #

Location for remote packages or archives assumed to be immutable.

Since: 0.1.0.0

Instances

Instances details
ToJSON PackageLocationImmutable 
Instance details

Defined in Pantry.Types

Generic PackageLocationImmutable 
Instance details

Defined in Pantry.Types

Associated Types

type Rep PackageLocationImmutable :: Type -> Type #

Show PackageLocationImmutable 
Instance details

Defined in Pantry.Types

NFData PackageLocationImmutable 
Instance details

Defined in Pantry.Types

Eq PackageLocationImmutable 
Instance details

Defined in Pantry.Types

Ord PackageLocationImmutable 
Instance details

Defined in Pantry.Types

Display PackageLocationImmutable 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved PackageLocationImmutable)) 
Instance details

Defined in Pantry.Types

type Rep PackageLocationImmutable 
Instance details

Defined in Pantry.Types

Snapshots

data RawSnapshotLocation #

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 BlobKey is used for reproducibility.

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

Instances details
ToJSON RawSnapshotLocation 
Instance details

Defined in Pantry.Types

Generic RawSnapshotLocation 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RawSnapshotLocation :: Type -> Type #

Show RawSnapshotLocation 
Instance details

Defined in Pantry.Types

NFData RawSnapshotLocation 
Instance details

Defined in Pantry.Types

Methods

rnf :: RawSnapshotLocation -> () #

Eq RawSnapshotLocation 
Instance details

Defined in Pantry.Types

Ord RawSnapshotLocation 
Instance details

Defined in Pantry.Types

Display RawSnapshotLocation 
Instance details

Defined in Pantry.Types

Pretty RawSnapshotLocation 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved RawSnapshotLocation)) 
Instance details

Defined in Pantry.Types

type Rep RawSnapshotLocation 
Instance details

Defined in Pantry.Types

data SnapshotLocation #

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 BlobKey is used for reproducibility.

Since: 0.1.0.0

SLFilePath !(ResolvedPath File)

Snapshot at a local file path.

Since: 0.1.0.0

Instances

Instances details
ToJSON SnapshotLocation 
Instance details

Defined in Pantry.Types

Generic SnapshotLocation 
Instance details

Defined in Pantry.Types

Associated Types

type Rep SnapshotLocation :: Type -> Type #

Show SnapshotLocation 
Instance details

Defined in Pantry.Types

NFData SnapshotLocation 
Instance details

Defined in Pantry.Types

Methods

rnf :: SnapshotLocation -> () #

Eq SnapshotLocation 
Instance details

Defined in Pantry.Types

Ord SnapshotLocation 
Instance details

Defined in Pantry.Types

Display SnapshotLocation 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved SnapshotLocation)) 
Instance details

Defined in Pantry.Types

type Rep SnapshotLocation 
Instance details

Defined in Pantry.Types

toRawSL :: SnapshotLocation -> RawSnapshotLocation #

Convert snapshot location to its "raw" equivalent.

Since: 0.1.0.0

data RawSnapshot #

A flattened representation of all the layers in a snapshot.

Since: 0.1.0.0

Constructors

RawSnapshot 

Fields

data Snapshot #

A flattened representation of all the layers in a snapshot.

Since: 0.1.0.0

Constructors

Snapshot 

Fields

data RawSnapshotPackage #

Settings for a package found in a snapshot.

Since: 0.1.0.0

Constructors

RawSnapshotPackage 

Fields

data SnapshotPackage #

Settings for a package found in a snapshot.

Since: 0.1.0.0

Constructors

SnapshotPackage 

Fields

Instances

Instances details
Show SnapshotPackage 
Instance details

Defined in Pantry.Types

data RawSnapshotLayer #

A single layer of a snapshot, i.e. a specific YAML configuration file.

Since: 0.1.0.0

Constructors

RawSnapshotLayer 

Fields

Instances

Instances details
ToJSON RawSnapshotLayer 
Instance details

Defined in Pantry.Types

Generic RawSnapshotLayer 
Instance details

Defined in Pantry.Types

Associated Types

type Rep RawSnapshotLayer :: Type -> Type #

Show RawSnapshotLayer 
Instance details

Defined in Pantry.Types

NFData RawSnapshotLayer 
Instance details

Defined in Pantry.Types

Methods

rnf :: RawSnapshotLayer -> () #

Eq RawSnapshotLayer 
Instance details

Defined in Pantry.Types

FromJSON (WithJSONWarnings (Unresolved RawSnapshotLayer)) 
Instance details

Defined in Pantry.Types

type Rep RawSnapshotLayer 
Instance details

Defined in Pantry.Types

data SnapshotLayer #

A single layer of a snapshot, i.e. a specific YAML configuration file.

Since: 0.1.0.0

Constructors

SnapshotLayer 

Fields

Instances

Instances details
ToJSON SnapshotLayer 
Instance details

Defined in Pantry.Types

Generic SnapshotLayer 
Instance details

Defined in Pantry.Types

Associated Types

type Rep SnapshotLayer :: Type -> Type #

Show SnapshotLayer 
Instance details

Defined in Pantry.Types

Eq SnapshotLayer 
Instance details

Defined in Pantry.Types

type Rep SnapshotLayer 
Instance details

Defined in Pantry.Types

toRawSnapshotLayer :: SnapshotLayer -> RawSnapshotLayer #

Convert snapshot layer into its "raw" equivalent.

Since: 0.1.0.0

data WantedCompiler #

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

Instances details
FromJSON WantedCompiler 
Instance details

Defined in Pantry.Types

FromJSONKey WantedCompiler 
Instance details

Defined in Pantry.Types

ToJSON WantedCompiler 
Instance details

Defined in Pantry.Types

Generic WantedCompiler 
Instance details

Defined in Pantry.Types

Associated Types

type Rep WantedCompiler :: Type -> Type #

Show WantedCompiler 
Instance details

Defined in Pantry.Types

NFData WantedCompiler 
Instance details

Defined in Pantry.Types

Methods

rnf :: WantedCompiler -> () #

Eq WantedCompiler 
Instance details

Defined in Pantry.Types

Ord WantedCompiler 
Instance details

Defined in Pantry.Types

Display WantedCompiler 
Instance details

Defined in Pantry.Types

type Rep WantedCompiler 
Instance details

Defined in Pantry.Types

data SnapName #

A snapshot synonym. It is expanded according to the field snapshotLocation of a PantryConfig.

@ since 0.5.0.0

Constructors

LTS 

Fields

  • !Int

    Major version

  • !Int

    Minor version ^ LTS Haskell snapshot, displayed as "lts-maj.min".

    Since: 0.5.0.0

Nightly !Day

Stackage Nightly snapshot, displayed as "nighly-YYYY-MM-DD".

Since: 0.5.0.0

Instances

Instances details
ToJSON SnapName 
Instance details

Defined in Pantry.Types

Generic SnapName 
Instance details

Defined in Pantry.Types

Associated Types

type Rep SnapName :: Type -> Type #

Methods

from :: SnapName -> Rep SnapName x #

to :: Rep SnapName x -> SnapName #

Show SnapName 
Instance details

Defined in Pantry.Types

NFData SnapName 
Instance details

Defined in Pantry.Types

Methods

rnf :: SnapName -> () #

Eq SnapName 
Instance details

Defined in Pantry.Types

Ord SnapName 
Instance details

Defined in Pantry.Types

Display SnapName 
Instance details

Defined in Pantry.Types

type Rep SnapName 
Instance details

Defined in Pantry.Types

snapshotLocation :: HasPantryConfig env => SnapName -> RIO env RawSnapshotLocation #

Get the location of a snapshot synonym from the PantryConfig.

Since: 0.5.0.0

Loading values

resolvePaths #

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

loadPackageRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env Package Source #

Load a Package from a RawPackageLocationImmutable.

Load the package either from the local DB, Casa, or as a last resort, the third party (hackage, archive or repo).

Since: 0.1.0.0

loadRawSnapshotLayer :: (HasPantryConfig env, HasLogFunc env) => RawSnapshotLocation -> RIO env (Either WantedCompiler (RawSnapshotLayer, CompletedSL)) Source #

Parse a SnapshotLayer value from a SnapshotLocation.

Returns a Left value if provided an SLCompiler constructor. Otherwise, returns a Right value providing both the Snapshot and a hash of the input configuration file.

Since: 0.1.0.0

loadSnapshotLayer :: (HasPantryConfig env, HasLogFunc env) => SnapshotLocation -> RIO env (Either WantedCompiler RawSnapshotLayer) Source #

Parse a SnapshotLayer value from a SnapshotLocation.

Returns a Left value if provided an SLCompiler constructor. Otherwise, returns a Right value providing both the Snapshot and a hash of the input configuration file.

Since: 0.1.0.0

loadSnapshot :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => SnapshotLocation -> RIO env RawSnapshot Source #

Parse a RawSnapshot (all layers) from a SnapshotLocation.

Since: 0.1.0.0

loadAndCompleteSnapshot Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> SnapshotLocation 
-> Map RawSnapshotLocation SnapshotLocation

Cached snapshot locations from lock file

-> Map RawPackageLocationImmutable PackageLocationImmutable

Cached locations from lock file

-> RIO env (Snapshot, [CompletedSL], [CompletedPLI]) 

Parse a Snapshot (all layers) from a SnapshotLocation noting any incomplete package locations. Debug output will include the raw snapshot layer.

Since: 0.1.0.0

loadAndCompleteSnapshot' Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Bool

Debug output includes the raw snapshot layer

-> SnapshotLocation 
-> Map RawSnapshotLocation SnapshotLocation

Cached snapshot locations from lock file

-> Map RawPackageLocationImmutable PackageLocationImmutable

Cached locations from lock file

-> RIO env (Snapshot, [CompletedSL], [CompletedPLI]) 

As for loadAndCompleteSnapshot but allows toggling of the debug output of the raw snapshot layer.

Since: 0.5.7

loadAndCompleteSnapshotRaw Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> RawSnapshotLocation 
-> Map RawSnapshotLocation SnapshotLocation

Cached snapshot locations from lock file

-> Map RawPackageLocationImmutable PackageLocationImmutable

Cached locations from lock file

-> RIO env (Snapshot, [CompletedSL], [CompletedPLI]) 

Parse a Snapshot (all layers) from a RawSnapshotLocation completing any incomplete package locations. Debug output will include the raw snapshot layer.

Since: 0.1.0.0

loadAndCompleteSnapshotRaw' Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Bool

Debug output includes the raw snapshot layer

-> RawSnapshotLocation 
-> Map RawSnapshotLocation SnapshotLocation

Cached snapshot locations from lock file

-> Map RawPackageLocationImmutable PackageLocationImmutable

Cached locations from lock file

-> RIO env (Snapshot, [CompletedSL], [CompletedPLI]) 

As for loadAndCompleteSnapshotRaw but allows toggling of the debug output of the raw snapshot layer.

Since: 0.5.7

data CompletedSL Source #

A completed snapshot location, including the original raw and completed information.

Since: 0.1.0.0

data CompletedPLI Source #

A completed package location, including the original raw and completed information.

Since: 0.1.0.0

addPackagesToSnapshot Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Utf8Builder

Text description of where these new packages are coming from, for error messages only

-> [RawPackageLocationImmutable]

new packages

-> AddPackagesConfig 
-> Map PackageName RawSnapshotPackage

packages from parent

-> RIO env (Map PackageName RawSnapshotPackage, AddPackagesConfig) 

Add more packages to a snapshot

Note that any settings on a parent flag which is being replaced will be ignored. For example, if package foo is in the parent and has flag bar set, and foo also appears in new packages, then bar will no longer be set.

Returns any of the AddPackagesConfig values not used.

Since: 0.1.0.0

data AddPackagesConfig Source #

Package settings to be passed to addPackagesToSnapshot.

Since: 0.1.0.0

Completion functions

data CompletePackageLocation Source #

Complete package location, plus whether the package has a cabal file. This is relevant to reproducibility, see https://tech.fpcomplete.com/blog/storing-generated-cabal-files

Since: 0.4.0.0

completePackageLocation :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env CompletePackageLocation Source #

Fill in optional fields in a PackageLocationImmutable for more reproducible builds.

Since: 0.1.0.0

completeSnapshotLocation :: (HasPantryConfig env, HasLogFunc env) => RawSnapshotLocation -> RIO env SnapshotLocation Source #

Add in hashes to make a SnapshotLocation reproducible.

Since: 0.1.0.0

warnMissingCabalFile :: HasLogFunc env => RawPackageLocationImmutable -> RIO env () #

Warn if the package uses PCHpack.

Since: 0.4.0.0

Parsers

parseSnapName :: MonadThrow m => Text -> m SnapName #

Parse the short representation of a SnapName.

Since: 0.5.0.0

parseHackageText :: Text -> Either PantryException (PackageIdentifier, BlobKey) #

Parse a hackage text.

Since: 0.1.0.0

Cabal values

parsePackageIdentifier :: String -> Maybe PackageIdentifier #

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 #

Parse a package name from a Value.

Since: 0.1.0.0

parsePackageNameThrowing :: MonadThrow m => String -> m PackageName #

Parse a package name from a Value throwing on failure

Since: 0.1.0.0

parseFlagName :: String -> Maybe FlagName #

Parse a flag name from a Value.

Since: 0.1.0.0

parseVersion :: String -> Maybe Version #

Parse a version from a Value.

Since: 0.1.0.0

parseVersionThrowing :: MonadThrow m => String -> m Version #

Parse a package version from a Value throwing on failure

Since: 0.1.0.0

Cabal helpers

packageIdentifierString :: PackageIdentifier -> String #

Render a package identifier as a Value.

Since: 0.1.0.0

packageNameString :: PackageName -> String #

Render a package name as a Value.

Since: 0.1.0.0

flagNameString :: FlagName -> String #

Render a flag name as a Value.

Since: 0.1.0.0

versionString :: Version -> String #

Render a version as a Value.

Since: 0.1.0.0

moduleNameString :: ModuleName -> String #

Render a module name as a Value.

Since: 0.1.0.0

newtype CabalString a #

Newtype wrapper for easier JSON integration with Cabal types.

Since: 0.1.0.0

Constructors

CabalString 

Fields

Instances

Instances details
IsCabalString a => FromJSON (CabalString a) 
Instance details

Defined in Pantry.Types

IsCabalString a => FromJSONKey (CabalString a) 
Instance details

Defined in Pantry.Types

Pretty a => ToJSON (CabalString a) 
Instance details

Defined in Pantry.Types

Pretty a => ToJSONKey (CabalString a) 
Instance details

Defined in Pantry.Types

Show a => Show (CabalString a) 
Instance details

Defined in Pantry.Types

Eq a => Eq (CabalString a) 
Instance details

Defined in Pantry.Types

Ord a => Ord (CabalString a) 
Instance details

Defined in Pantry.Types

toCabalStringMap :: Map a v -> Map (CabalString a) v #

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 #

Unwrap the CabalString from the keys in a Map to use a FromJSON instance.

Since: 0.1.0.0

Package location

fetchPackages :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env, Foldable f) => f PackageLocationImmutable -> RIO env () Source #

Download all of the packages provided into the local cache without performing any unpacking. Can be useful for build tools wanting to prefetch or provide an offline mode.

Since: 0.1.0.0

unpackPackageLocationRaw Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Path Abs Dir

unpack directory

-> RawPackageLocationImmutable 
-> RIO env () 

Unpack a given RawPackageLocationImmutable into the given directory. Does not generate any extra subdirectories.

Since: 0.1.0.0

unpackPackageLocation Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Path Abs Dir

unpack directory

-> PackageLocationImmutable 
-> RIO env () 

Unpack a given PackageLocationImmutable into the given directory. Does not generate any extra subdirectories.

Since: 0.1.0.0

getPackageLocationName :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env PackageName Source #

Get the PackageName of the package at the given location.

Since: 0.1.0.0

getRawPackageLocationIdent :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env PackageIdentifier Source #

Get the PackageIdentifier of the package at the given location.

Since: 0.1.0.0

packageLocationIdent :: PackageLocationImmutable -> PackageIdentifier Source #

Get the PackageIdentifier of the package at the given location.

Since: 0.1.0.0

packageLocationVersion :: PackageLocationImmutable -> Version Source #

Get version of the package at the given location.

Since: 0.1.0.0

getRawPackageLocationTreeKey :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env TreeKey Source #

Get the EntityField of the package at the given location.

Since: 0.1.0.0

getPackageLocationTreeKey :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env TreeKey Source #

Get the EntityField of the package at the given location.

Since: 0.1.0.0

Cabal files

loadCabalFileRaw Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Maybe Text

The program name used by Hpack (the library), defaults to "hpack".

-> RawPackageLocation 
-> RIO env GenericPackageDescription 

Same as loadCabalFileRawImmutable, but takes a RawPackageLocation. Never prints warnings, see loadCabalFilePath for that.

Since: 0.8.0

loadCabalFile Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Maybe Text

The program name used by Hpack (the library), defaults to "hpack".

-> PackageLocation 
-> RIO env GenericPackageDescription 

Same as loadCabalFileImmutable, but takes a PackageLocation. Never prints warnings, see loadCabalFilePath for that.

Since: 0.8.0

loadCabalFileRawImmutable :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env GenericPackageDescription Source #

Load the cabal file for the given RawPackageLocationImmutable.

This function ignores all warnings.

Note that, for now, this will not allow support for hpack files in these package locations. Instead, all PackageLocationImmutables will require a .cabal file. This may be relaxed in the future.

Since: 0.1.0.0

loadCabalFileImmutable :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env GenericPackageDescription Source #

Load the cabal file for the given PackageLocationImmutable.

This function ignores all warnings.

Since: 0.1.0.0

loadCabalFilePath Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Maybe Text

The program name used by Hpack (the library), defaults to "hpack".

-> Path Abs Dir

project directory, with a cabal file or hpack file

-> RIO env (PrintWarnings -> IO GenericPackageDescription, PackageName, Path Abs File) 

Parse the Cabal file for the package inside the given directory. Performs various sanity checks, such as the file name being correct and having only a single Cabal file.

Since: 0.8.0

findOrGenerateCabalFile Source #

Arguments

:: forall env. (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> Maybe Text

The program name used by Hpack (the library), defaults to "hpack".

-> Path Abs Dir

package directory

-> RIO env (PackageName, Path Abs File) 

Get the file name for the Cabal file in the given directory.

If no Cabal file is present, or more than one is present, an exception is thrown via throwM.

If the directory contains a file named package.yaml, Hpack is used to generate a Cabal file from it.

Since: 0.8.0

data PrintWarnings #

Should we print warnings when loading a cabal file?

Since: 0.1.0.0

Hackage index

updateHackageIndex Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env) 
=> Maybe Utf8Builder

reason for updating, if any

-> RIO env DidUpdateOccur 

Download the most recent 01-index.tar file from Hackage and update the database tables.

This function will only perform an update once per PantryConfig for user sanity. See the return value to find out if it happened.

Since: 0.1.0.0

data DidUpdateOccur Source #

Did an update occur when running updateHackageIndex?

Since: 0.1.0.0

data RequireHackageIndex Source #

Require that the Hackage index is populated.

Since: 0.1.0.0

Constructors

YesRequireHackageIndex

If there is nothing in the Hackage index, then perform an update

NoRequireHackageIndex

Do not perform an update

Instances

Instances details
Show RequireHackageIndex Source # 
Instance details

Defined in Pantry.Hackage

hackageIndexTarballL :: HasPantryConfig env => SimpleGetter env (Path Abs File) Source #

Where does pantry download its 01-index.tar file from Hackage?

Since: 0.1.0.0

getHackagePackageVersions Source #

Returns the versions of the package available on Hackage.

Since: 0.1.0.0

getLatestHackageVersion Source #

Returns the latest version of the given package available from Hackage.

Since: 0.1.0.0

getLatestHackageLocation Source #

Returns location of the latest version of the given package available from Hackage.

Since: 0.1.0.0

getLatestHackageRevision Source #

Arguments

:: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) 
=> RequireHackageIndex 
-> PackageName

package name

-> Version 
-> RIO env (Maybe (Revision, BlobKey, TreeKey)) 

Returns the latest revision of the given package version available from Hackage.

Since: 0.1.0.0

getHackageTypoCorrections :: (HasPantryConfig env, HasLogFunc env) => PackageName -> RIO env [PackageName] Source #

Try to come up with typo corrections for given package identifier using Hackage package names. This can provide more user-friendly information in error messages.

Since: 0.1.0.0

loadGlobalHints :: (HasTerm env, HasPantryConfig env) => WantedCompiler -> RIO env (Maybe (Map PackageName Version)) Source #

Load the global hints from GitHub.

Since: 0.1.0.0

partitionReplacedDependencies Source #

Arguments

:: Ord id 
=> Map PackageName a

global packages

-> (a -> PackageName)

package name getter

-> (a -> id)

returns unique package id used for dependency pruning

-> (a -> [id])

returns unique package ids of direct package dependencies

-> Set PackageName

overrides which global dependencies should get pruned

-> (Map PackageName [PackageName], Map PackageName a) 

Partition a map of global packages with its versions into a Set of replaced packages and its dependencies and a map of remaining (untouched) packages.

Since: 0.1.0.0

Snapshot cache

newtype SnapshotCacheHash #

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

Instances

Instances details
Show SnapshotCacheHash 
Instance details

Defined in Pantry.Types

withSnapshotCache :: (HasPantryConfig env, HasLogFunc env) => SnapshotCacheHash -> RIO env (Map PackageName (Set ModuleName)) -> ((ModuleName -> RIO env [PackageName]) -> RIO env a) -> RIO env a Source #

Use a snapshot cache, which caches which modules are in which packages in a given snapshot. This is mostly intended for usage by Stack.

Since: 0.1.0.0