Safe Haskell | None |
---|---|
Language | Haskell2010 |
Obtaining information about packages over THE INTERNET!
Synopsis
- data PkgInfo m = PkgInfo {
- pkgVersions :: Map SemVer (PkgRevInfo m)
- pkgLookupCommit :: Maybe Text -> m (PkgRevInfo m)
- lookupPkgRev :: SemVer -> PkgInfo m -> Maybe (PkgRevInfo m)
- pkgInfo :: (MonadIO m, MonadLogger m, MonadFail m) => PkgPath -> m (Either Text (PkgInfo m))
- data PkgRevInfo m = PkgRevInfo {}
- data GetManifest m
- downloadZipball :: (MonadLogger m, MonadIO m, MonadFail m) => Text -> m Archive
- data PkgRegistry m
- class (MonadIO m, MonadLogger m, MonadFail m) => MonadPkgRegistry m where
- getPkgRegistry :: m (PkgRegistry m)
- putPkgRegistry :: PkgRegistry m -> m ()
- modifyPkgRegistry :: (PkgRegistry m -> PkgRegistry m) -> m ()
- lookupPackage :: MonadPkgRegistry m => PkgPath -> m (PkgInfo m)
- lookupPackageRev :: MonadPkgRegistry m => PkgPath -> SemVer -> m (PkgRevInfo m)
- lookupNewestRev :: MonadPkgRegistry m => PkgPath -> m SemVer
Package info
Information about a package. The name of the package is stored separately.
PkgInfo | |
|
lookupPkgRev :: SemVer -> PkgInfo m -> Maybe (PkgRevInfo m) Source #
pkgInfo :: (MonadIO m, MonadLogger m, MonadFail m) => PkgPath -> m (Either Text (PkgInfo m)) Source #
Retrieve information about a package based on its package path.
This uses Semantic Import Versioning when interacting with
repositories. For example, a package github.comuserrepo
will
match version 0.* or 1.* tags only, a package
github.comuserrepo/v2
will match 2.* tags, and so forth..
data PkgRevInfo m Source #
Information about a version of a single package. The version number is stored separately.
PkgRevInfo | |
|
Instances
Eq (PkgRevInfo m) Source # | |
Defined in Futhark.Pkg.Info (==) :: PkgRevInfo m -> PkgRevInfo m -> Bool # (/=) :: PkgRevInfo m -> PkgRevInfo m -> Bool # | |
Show (PkgRevInfo m) Source # | |
Defined in Futhark.Pkg.Info showsPrec :: Int -> PkgRevInfo m -> ShowS # show :: PkgRevInfo m -> String # showList :: [PkgRevInfo m] -> ShowS # |
data GetManifest m Source #
The manifest is stored as a monadic action, because we want to fetch them on-demand. It would be a waste to fetch it information for every version of every package if we only actually need a small subset of them.
Instances
Eq (GetManifest m) Source # | |
Defined in Futhark.Pkg.Info (==) :: GetManifest m -> GetManifest m -> Bool # (/=) :: GetManifest m -> GetManifest m -> Bool # | |
Show (GetManifest m) Source # | |
Defined in Futhark.Pkg.Info showsPrec :: Int -> GetManifest m -> ShowS # show :: GetManifest m -> String # showList :: [GetManifest m] -> ShowS # |
downloadZipball :: (MonadLogger m, MonadIO m, MonadFail m) => Text -> m Archive Source #
Package registry
data PkgRegistry m Source #
A package registry is a mapping from package paths to information about the package. It is unlikely that any given registry is global; rather small registries are constructed on-demand based on the package paths referenced by the user, and may also be combined monoidically. In essence, the PkgRegistry is just a cache.
Instances
Semigroup (PkgRegistry m) Source # | |
Defined in Futhark.Pkg.Info (<>) :: PkgRegistry m -> PkgRegistry m -> PkgRegistry m # sconcat :: NonEmpty (PkgRegistry m) -> PkgRegistry m # stimes :: Integral b => b -> PkgRegistry m -> PkgRegistry m # | |
Monoid (PkgRegistry m) Source # | |
Defined in Futhark.Pkg.Info mempty :: PkgRegistry m # mappend :: PkgRegistry m -> PkgRegistry m -> PkgRegistry m # mconcat :: [PkgRegistry m] -> PkgRegistry m # |
class (MonadIO m, MonadLogger m, MonadFail m) => MonadPkgRegistry m where Source #
Monads that support a stateful package registry. These are also
required to be instances of MonadIO
because most package registry
operations involve network operations.
getPkgRegistry :: m (PkgRegistry m) Source #
putPkgRegistry :: PkgRegistry m -> m () Source #
modifyPkgRegistry :: (PkgRegistry m -> PkgRegistry m) -> m () Source #
lookupPackage :: MonadPkgRegistry m => PkgPath -> m (PkgInfo m) Source #
lookupPackageRev :: MonadPkgRegistry m => PkgPath -> SemVer -> m (PkgRevInfo m) Source #
Look up information about a specific version of a package.
lookupNewestRev :: MonadPkgRegistry m => PkgPath -> m SemVer Source #
Find the newest version of a package.