This module contains the data types for a package specification and versions as well as functions for reading/showing/comparing package specs and package versions.
initialVersion
:: (Int,Int,Int,Maybe String)
The initial version of a new package. |
nextMajor
:: (Int,Int,Int,Maybe String) -> (Int,Int,Int,Maybe String)
The next major version of a given version. |
nextMinor
:: (Int,Int,Int,Maybe String) -> (Int,Int,Int,Maybe String)
The next minor version of a given version. |
emptyPackage
:: Package
An empty package specification. |
execOfPackage
:: Package -> String
Returns the name of the executable of the package. |
packageSpecToJSON
:: Package -> JValue
Translates a package to a JSON object. |
writePackageSpec
:: Package -> String -> IO ()
Writes a basic package specification to a JSON file. |
loadPackageSpecELM
:: String -> ErrorLoggerIO Package
Loads a package specification from a package directory. |
loadPackageSpec
:: String -> IO ([LogEntry],Either LogEntry Package)
Loads a package specification from a package directory. |
packageIdEq
:: Package -> Package -> Bool
Checks whether two package ids are equal, i.e. |
showSourceOfPackage
:: Package -> String
Shows the package source in human-readable format. |
replaceVersionInTag
:: Package -> String -> String
Replace the string $version$
in a tag string by the current version.
|
vlt
:: (Int,Int,Int,Maybe String) -> (Int,Int,Int,Maybe String) -> Bool
Less than operator for versions. |
vlte
:: (Int,Int,Int,Maybe String) -> (Int,Int,Int,Maybe String) -> Bool
Less than or equal operator for versions. |
vgt
:: (Int,Int,Int,Maybe String) -> (Int,Int,Int,Maybe String) -> Bool
Greater than operator for versions. |
vgte
:: (Int,Int,Int,Maybe String) -> (Int,Int,Int,Maybe String) -> Bool
Greater than or equal operator for versions. |
isPreRelease
:: (Int,Int,Int,Maybe String) -> Bool
Is the version a pre-release version? |
sourceDirsOf
:: Package -> [String]
Gets the list of source directories of a package. |
dependencyNames
:: Package -> [String]
Gets the package names of all dependencies of a package. |
showDependency
:: Dependency -> String
Renders a dependency as a string, including all version constraints. |
showCompilerDependency
:: CompilerCompatibility -> String
Renders a compiler dependency as a string, including all version constraints. |
showVersionConstraints
:: [[VersionConstraint]] -> String
Renders a list of version constraints in disjunctive normal form. |
packageId
:: Package -> String
Renders the id of a package as a string. |
readPackageSpec
:: String -> Either String Package
Reads a package spec from a JSON string. |
readVersionConstraints
:: String -> Maybe [[VersionConstraint]]
Reads a dependency constraint expression in disjunctive normal form into a list of lists of version constraints. |
readVersionConstraint
:: String -> Maybe VersionConstraint
Parses a version constraint. |
showVersion
:: (Int,Int,Int,Maybe String) -> String
Shows a version in dotted notation. |
readVersion
:: String -> Maybe (Int,Int,Int,Maybe String)
Tries to parse a version string. |
Data type representin a version number. It is a tuple where the components are major, minor, patch, prerelease, e.g., 3.1.1-rc5
Type synonym: Version = (Int,Int,Int,Maybe String)
Type synonym: Conjunction = [VersionConstraint]
Type synonym: Disjunction = [Conjunction]
A dependency on another package. The disjunctive normal form of a boolean combination of version constraints is represented by a list of lists of version constraint. Each inner list of version constraints is a conjunction, the outer list is a disjunction.
Constructors:
Dependency
:: String -> Disjunction -> Dependency
A version constraint.
Constructors:
VExact
:: Version -> VersionConstraint
: versions must match exactly
VGt
:: Version -> VersionConstraint
: version must be strictly larger than specified version
VLt
:: Version -> VersionConstraint
: version must be strictly smaller than specified version
VGte
:: Version -> VersionConstraint
: version must be larger or equal to specified version
VLte
:: Version -> VersionConstraint
: version must be smaller or equal to specified version
VMinCompatible
:: Version -> VersionConstraint
: version must be larger or equal and
within same minor version
VMajCompatible
:: Version -> VersionConstraint
: version must be larger or equal and
within same minor version
Compiler compatibility constraint, takes the name of the compiler (kics2 or pakcs), as well as a disjunctive normal form combination of version constraints (see Dependency).
Constructors:
CompilerCompatibility
:: String -> Disjunction -> CompilerCompatibility
A package id consisting of the package name and version.
Constructors:
PackageId
:: String -> Version -> PackageId
The specification to generate an executable from the package.
It consists of the name of the executable, the name of the main
module (which must contain an operation main
), and list
of options for various compilers (i.e., pairs of compiler name and
options for this compiler).
Constructors:
PackageExecutable
:: String -> String -> [(String,String)] -> PackageExecutable
The specification of a single test suite for a package. It consists of a directory, a list of modules, options (for CurryCheck), and a name of a test script in this directory. The test script can be empty, but then a non-empty list of modules must be provided. This structure specifies a test which is performed in the given directory by running CurryCheck on the given list of modules where the option string is passed to CurryCheck.
Constructors:
PackageTest
:: String -> [String] -> String -> String -> PackageTest
The specification to generate the documentation of the package. It consists of the name of the directory containing the documentation, a main file (usually, a LaTeX file) containing the documentation, and a command to generate the documentation. If the command is missing and the main file has the suffix "tex", e.g., "manual.tex", the default command is "pdflatex manual.tex".
Constructors:
PackageDocumentation
:: String -> String -> String -> PackageDocumentation
A source where the contents of a package can be acquired.
Constructors:
Http
:: String -> PackageSource
: URL to a ZIP file
Git
:: String -> (Maybe GitRevision) -> PackageSource
: URL to a Git repository and an optional revision spec to check
out
FileSource
:: String -> PackageSource
: The path to a ZIP file to install. Cannot be specified in
a package specification file, for internal use only.
A Git revision.
Constructors:
Tag
:: String -> GitRevision
: A tag which might contain the string $version$
which will
be replaced by the package version
Ref
:: String -> GitRevision
: A Git commitish
, i.e. a SHA, a branch name, a tag name etc.
VersionAsTag
:: GitRevision
: Use the package version prefixed with a v
as the tag
The data type for package specifications.
Constructors:
Package
:: String -> Version -> [String] -> [String] -> String -> (Maybe String) -> [String] -> (Maybe String) -> (Maybe String) -> (Maybe String) -> (Maybe String) -> (Maybe String) -> (Maybe String) -> [Dependency] -> [CompilerCompatibility] -> (Maybe PackageSource) -> [String] -> [String] -> (Maybe String) -> (Maybe PackageExecutable) -> (Maybe [PackageTest]) -> (Maybe PackageDocumentation) -> Package
Fields:
name
:: String
version
:: Version
author
:: [String]
maintainer
:: [String]
synopsis
:: String
description
:: (Maybe String)
category
:: [String]
license
:: (Maybe String)
licenseFile
:: (Maybe String)
copyright
:: (Maybe String)
homepage
:: (Maybe String)
bugReports
:: (Maybe String)
repository
:: (Maybe String)
dependencies
:: [Dependency]
compilerCompatibility
:: [CompilerCompatibility]
source
:: (Maybe PackageSource)
sourceDirs
:: [String]
exportedModules
:: [String]
configModule
:: (Maybe String)
executableSpec
:: (Maybe PackageExecutable)
testSuite
:: (Maybe [PackageTest])
documentation
:: (Maybe PackageDocumentation)
The initial version of a new package.
|
The next major version of a given version. |
The next minor version of a given version. |
An empty package specification.
|
Returns the name of the executable of the package. Returns the empty string if the package has no executable to install. |
Translates a package to a JSON object. |
Writes a basic package specification to a JSON file.
|
Loads a package specification from a package directory.
|
Loads a package specification from a package directory.
|
Checks whether two package ids are equal, i.e. if their names and versions match.
|
Shows the package source in human-readable format. |
Replace the string |
Less than operator for versions. |
Less than or equal operator for versions. |
Greater than operator for versions. |
Greater than or equal operator for versions. |
Is the version a pre-release version?
|
Gets the list of source directories of a package.
It is either the field |
Gets the package names of all dependencies of a package. |
Renders a dependency as a string, including all version constraints. |
Renders a compiler dependency as a string, including all version constraints. |
Renders a list of version constraints in disjunctive normal form. |
Renders the id of a package as a string. Package name and version separated by a dash. |
Reads a package spec from a JSON string. |
Reads a dependency constraint expression in disjunctive normal form into a list of lists of version constraints. The inner lists are conjunctions of version constraints, the outer list is a disjunction of conjunctions.
|
Parses a version constraint.
|
Shows a version in dotted notation. |
Tries to parse a version string. |