Idris2Doc : Pack.Core.Types

Pack.Core.Types

(source)
We work a lot with Strings of distinct semantics.
Since I've been bitten by this more than once, we wrap
the in single field record types to drastically increase
type safety.

Reexports

importpublic Data.FilePath.File

Definitions

quote : Interpolationa=>a->String
  This puts a value in quotes during interpolation.

Note: If the interpolated string contains additional quote
characters, these will *not* be escaped.

Totality: total
Visibility: export
relativeTo : PathAbs->PathAbs->PathRel
  Returns the second path, relative to the first one
For instance, `relativeTo /foo/bar/baz /foo/quux` will return
`../../quux`.

Totality: total
Visibility: export
isIpkgBody : Body->Bool
  True if the given file path body ends on `.ipkg`

Totality: total
Visibility: export
isTomlBody : Body->Bool
  True if the given file path body ends on `.toml`

Totality: total
Visibility: export
isHtmlBody : Body->Bool
  True if the given file path body ends on `.html`

Totality: total
Visibility: export
toAbsPath : PathAbs->FilePath->PathAbs
  Converts a `FilePath` - which might hold a relative
or an absolute path - to an absolute path by interpreting
a relative path being relative to the given parent directory.

Totality: total
Visibility: export
parse : String->PathAbs->PathAbs
  Parses a string, converting it to either a relative
or absolute path and using `toAbsPath` to convert the result
to an absolute path.

Totality: total
Visibility: export
(<//>) : Casta (PathRel) =>Patht->a->Patht
  More flexible version of `</>` (path concatenation).

Totality: total
Visibility: export
Fixity Declaration: infixl operator, level 5
(//>) : CastaBody=>Patht->a->Patht
  More flexible version of `//>`
(appending a file path body to an absolute path)

Totality: total
Visibility: export
Fixity Declaration: infixl operator, level 5
(<->) : CastaBody=>CastbBody=>a->b->Body
  Concatenate two file path bodies with a hyphen inbetween.

Totality: total
Visibility: export
Fixity Declaration: infixl operator, level 8
toAbsFile : PathAbs->FileRel->FileAbs
  Convert a relative file path to an absolute one by appending
it to the given parent directory.

Totality: total
Visibility: export
recordPackDirs : Type
  The directory where package collections, global user settings,
and cached `.ipkg` files are stored.

Totality: total
Visibility: public export
Constructor: 
PD : PathAbs->PathAbs->PathAbs->PathAbs->PackDirs

Projections:
.bin : PackDirs->PathAbs
  Directory where executables will be installed.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_BIN_DIR`
* `$HOME/.local/bin`
.cache : PackDirs->PathAbs
  Directory with cached data such as cached `.ipkg` files, git repos,
and temporary files used during installation of libs.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_CACHE_DIR`
* `$XDG_CACHE_HOME/pack`
* `$HOME/.cache/pack`
.state : PackDirs->PathAbs
  Directory with application state (installed compiler and libraries).

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_STATE_DIR`
* `$XDG_STATE_HOME/pack`
* `$HOME/.local/state/pack`
.user : PackDirs->PathAbs
  Directory with user settings.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_USER_DIR`
* `$XDG_CONFIG_HOME/pack`
* `$HOME/.config/pack`

Hint: 
Env=>PackDirs
.user : PackDirs->PathAbs
  Directory with user settings.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_USER_DIR`
* `$XDG_CONFIG_HOME/pack`
* `$HOME/.config/pack`

Totality: total
Visibility: public export
user : PackDirs->PathAbs
  Directory with user settings.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_USER_DIR`
* `$XDG_CONFIG_HOME/pack`
* `$HOME/.config/pack`

Totality: total
Visibility: public export
.state : PackDirs->PathAbs
  Directory with application state (installed compiler and libraries).

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_STATE_DIR`
* `$XDG_STATE_HOME/pack`
* `$HOME/.local/state/pack`

Totality: total
Visibility: public export
state : PackDirs->PathAbs
  Directory with application state (installed compiler and libraries).

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_STATE_DIR`
* `$XDG_STATE_HOME/pack`
* `$HOME/.local/state/pack`

Totality: total
Visibility: public export
.cache : PackDirs->PathAbs
  Directory with cached data such as cached `.ipkg` files, git repos,
and temporary files used during installation of libs.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_CACHE_DIR`
* `$XDG_CACHE_HOME/pack`
* `$HOME/.cache/pack`

Totality: total
Visibility: public export
cache : PackDirs->PathAbs
  Directory with cached data such as cached `.ipkg` files, git repos,
and temporary files used during installation of libs.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_CACHE_DIR`
* `$XDG_CACHE_HOME/pack`
* `$HOME/.cache/pack`

Totality: total
Visibility: public export
.bin : PackDirs->PathAbs
  Directory where executables will be installed.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_BIN_DIR`
* `$HOME/.local/bin`

Totality: total
Visibility: public export
bin : PackDirs->PathAbs
  Directory where executables will be installed.

Depending on what environment variables are set, this defaults to
(in decreasing order of priority):

* `PACK_BIN_DIR`
* `$HOME/.local/bin`

Totality: total
Visibility: public export
dataCurDir : Type
  The directory from which the pack application was invoked.

Totality: total
Visibility: public export
Constructor: 
CD : PathAbs->CurDir

Hints:
CurDir=>Arg (FileAbs)
CurDir=>Arg (PathAbs)
CurDir=>ArgPkgOrIpkg
InterpolationCurDir
curDir : CurDir=>PathAbs
  Use this when you need access to the current directory's path with
only a value of type `CurDir` in scope.

Totality: total
Visibility: export
dataTmpDir : Type
  The directory where temporary files and git repos will be
kept.

Totality: total
Visibility: public export
Constructor: 
TD : PathAbs->TmpDir

Hints:
InterpolationTmpDir
Env=>TmpDir
tmpDir : TmpDir=>PathAbs
  Use this when you need access to the `PACK_DIR` path with
only a value of type `PackDir` in scope.

Totality: total
Visibility: export
recordTTCVersion : Type
  The TTC-Version currently used by the Idris compiler

Totality: total
Visibility: public export
Constructor: 
TTCV : MaybeBody->TTCVersion

Projection: 
.version : TTCVersion->MaybeBody

Hint: 
IdrisEnv=>TTCVersion
.version : TTCVersion->MaybeBody
Totality: total
Visibility: public export
version : TTCVersion->MaybeBody
Totality: total
Visibility: public export
ttcVersion : TTCVersion=>MaybeBody
  Use this when you need access to the current TTC version
only a value of type `TTCVersion` in scope.

Totality: total
Visibility: export
recordURL : Type
  URL mostly used to represent Git repositories.

Totality: total
Visibility: public export
Constructor: 
MkURL : String->URL

Projection: 
.value : URL->String

Hints:
CastURL (PathRel)
EqURL
FromStringURL
FromTOMLURL
InterpolationURL
ShowURL
Uninhabited (IsCore (Git{_:2638}{_:2633}{_:2637}{_:2636}{_:2635}{_:2634}))
Uninhabited (IsLocal (Git{_:2792}{_:2787}{_:2791}{_:2790}{_:2789}{_:2788}))
.value : URL->String
Totality: total
Visibility: public export
value : URL->String
Totality: total
Visibility: public export
recordCommit : Type
  A git commit hash or tag.

Totality: total
Visibility: public export
Constructor: 
MkCommit : String->Commit

Projection: 
.value : Commit->String

Hints:
CastCommit (PathRel)
EqCommit
FromStringCommit
FromTOMLCommit
InterpolationCommit
ShowCommit
Uninhabited (IsCore (Local{_:2589}{_:2588}{_:2587}{_:2586}))
Uninhabited (IsCore (Git{_:2638}{_:2633}{_:2637}{_:2636}{_:2635}{_:2634}))
Uninhabited (IsLocal (Core{_:2761}))
Uninhabited (IsLocal (Git{_:2792}{_:2787}{_:2791}{_:2790}{_:2789}{_:2788}))
Uninhabited (IsGit (Core{_:2920}))
Uninhabited (IsGit (Local{_:2946}{_:2945}{_:2944}{_:2943}))
.value : Commit->String
Totality: total
Visibility: public export
value : Commit->String
Totality: total
Visibility: public export
recordHash : Type
  A hash generated by pack

Totality: total
Visibility: public export
Constructor: 
MkHash : String->Hash

Projection: 
.value : Hash->String

Hints:
CastHash (PathRel)
EqHash
FromStringHash
InterpolationHash
ShowHash
.value : Hash->String
Totality: total
Visibility: public export
value : Hash->String
Totality: total
Visibility: public export
recordBranch : Type
  A branch in a git repo.

Totality: total
Visibility: public export
Constructor: 
MkBranch : String->Branch

Projection: 
.value : Branch->String

Hints:
CastBranch (PathRel)
EqBranch
FromStringBranch
FromTOMLBranch
InterpolationBranch
ShowBranch
.value : Branch->String
Totality: total
Visibility: public export
value : Branch->String
Totality: total
Visibility: public export
recordPkgName : Type
  Name of an Idris package

Totality: total
Visibility: public export
Constructor: 
MkPkgName : String->PkgName

Projection: 
.value : PkgName->String

Hints:
ArgPkgName
Arg (ListPkgName)
CastPkgName (PathRel)
EqPkgName
FromStringPkgName
FromTOMLPkgName
InterpolationPkgName
OrdPkgName
ShowPkgName
TOMLKeyPkgName
.value : PkgName->String
Totality: total
Visibility: public export
value : PkgName->String
Totality: total
Visibility: public export
dataPkgOrIpkg : Type
  Several pack commands operat either on a pack package or a local
`.ipkg` file. This data type represents such command line arguments.

Totality: total
Visibility: public export
Constructors:
Pkg : PkgName->PkgOrIpkg
Ipkg : FileAbs->PkgOrIpkg

Hint: 
CurDir=>ArgPkgOrIpkg
dataPkgType : Type
  Type of an Idris package (either a library or a binary).

Totality: total
Visibility: public export
Constructors:
PLib : PkgType
PApp : PkgType

Hints:
ArgPkgType
EqPkgType
InterpolationPkgType
OrdPkgType
dataInstallType : Type
  What we want to install: A library, an application to
run it from within pack, or an application, which should
be available via the `PATH` variable.

Totality: total
Visibility: public export
Constructors:
Library : InstallType
App : Bool->InstallType

Hints:
EqInstallType
InterpolationInstallType
OrdInstallType
recordDBName : Type
  Name of a package collection. This must be a valid
file path body.

Totality: total
Visibility: public export
Constructor: 
MkDBName : Body->DBName

Projection: 
.value : DBName->Body

Hints:
ArgDBName
CastDBNameBody
EqDBName
FromTOMLDBName
InterpolationDBName
OrdDBName
TOMLKeyDBName
.value : DBName->Body
Totality: total
Visibility: public export
value : DBName->Body
Totality: total
Visibility: public export
Head : DBName
Totality: total
Visibility: export
All : DBName
Totality: total
Visibility: export
recordDesc : (PkgDesc->Type) ->Type
  A tagged package desc. We use the tag mainly to make sure that
the package desc in question has been checked for safety issues.
Since the tag is parameterized by a `PkgDesc`, we make sure
we will not inadvertently use a tag for a `PkgDesc` different to
the one we wrapped.

Totality: total
Visibility: public export
Constructor: 
MkDesc : (desc : PkgDesc) ->String->FileAbs-> (0_ : tdesc) ->Desct

Projections:
.cont : Desct->String
  String content of the `.ipkg` file used when reading the package desc
.desc : Desct->PkgDesc
  The parsed package desc
.path : Desct->FileAbs
  Path to the file use when reading the package desc
0.tag : ({rec:0} : Desct) ->t (desc{rec:0})
  Security tag. See `Pack.Runner.Database.check`
.desc : Desct->PkgDesc
  The parsed package desc

Totality: total
Visibility: public export
desc : Desct->PkgDesc
  The parsed package desc

Totality: total
Visibility: public export
.cont : Desct->String
  String content of the `.ipkg` file used when reading the package desc

Totality: total
Visibility: public export
cont : Desct->String
  String content of the `.ipkg` file used when reading the package desc

Totality: total
Visibility: public export
.path : Desct->FileAbs
  Path to the file use when reading the package desc

Totality: total
Visibility: public export
path : Desct->FileAbs
  Path to the file use when reading the package desc

Totality: total
Visibility: public export
0.tag : ({rec:0} : Desct) ->t (desc{rec:0})
  Security tag. See `Pack.Runner.Database.check`

Totality: total
Visibility: public export
0tag : ({rec:0} : Desct) ->t (desc{rec:0})
  Security tag. See `Pack.Runner.Database.check`

Totality: total
Visibility: public export
0U : PkgDesc->Type
  This is used as a tag for unchecked `Desc`s.

Totality: total
Visibility: public export
dependencies : PkgDesc->ListPkgName
  Lists the dependencies of a package.

Totality: total
Visibility: export
dependencies : Desct->ListPkgName
  Lists the dependencies of a package.

Totality: total
Visibility: export
dataCmdArg : Type
  A command line argument of a call to the system shell.

Totality: total
Visibility: public export
Constructors:
Escapable : String->CmdArg
  Escapable alternative represents a string that should be understood as a
single argument disregarding its contents, i.e. the whole string should
be passed as an argument even if it contains spaces or characters that
are normally understood specially by shell.
NoEscape : String->CmdArg
  No escape alternative represents a raw string that is used "as is" at the
shell call, thus allowing to pass commands to the shell itself.
Be aware that spaces inside these strings would form several actual
arguments and quotation marks and backslash symbols may interfere with
escaping of other arguments.

Hint: 
CmdArgableCmdArg
interfaceCmdArgable : Type->Type
  Interface that is used to mark which types can be used as a source for
command line arguments when building lists of such.
This allows to be able to pass different literals and expressions without
explicit wrapping them into the `CmdArg` type.

Parameters: a
Methods:
toCmdArg : a->CmdArg

Implementations:
CmdArgableCmdArg
Interpolationa=>CmdArgablea
toCmdArg : CmdArgablea=>a->CmdArg
Totality: total
Visibility: public export
dataCmdArgList : Type
  A list of command line arguments.

This type is meant to look syntacitcally as a simple list, however
containing possibly values of different types which can form a command
line argument.

For example, a call to some command with redirection may look like this:
`sys ["echo", "a", NoEscape ">", file]`,
when, say, `file` is a value of type `File Abs`.

Totality: total
Visibility: public export
Constructors:
Nil : CmdArgList
(::) : CmdArgablea=>a->CmdArgList->CmdArgList

Hints:
ArgCmdArgList
FromTOMLCmdArgList
MonoidCmdArgList
SemigroupCmdArgList
escapeCmd : CmdArgList->String
  Converts a list of command line arguments to a single string
while putting spaces between arguments and escaping appropriate ones.

For example, call `escapeCmd ["echo", "&&", NoEscape "&&", "echo", "yes"]`
would return a string equivalent to the literal
`#""echo" "&&" && "echo" "yes""#`.

Totality: total
Visibility: export
(++) : CmdArg->CmdArg->CmdArg
  Concatenate two command line arguments into one.

This operation respects meaning of the contents of each argument,
whether they should be escaped or not.
This allows, say, to form an argument which partially contains something
escapable and partially contains a special shell argument, for example
`sys ["cp", "-r", Escapable "\{dirName}/" ++ NoEscape "*", dest]` would
list files with shell's `*` even if `dirName` contains spaces.

Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 7
(++) : CmdArgList->CmdArgList->CmdArgList
  Concatenation operation for command line argument lists.

Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 7
concatMap : Monoidm=> (CmdArg->m) ->CmdArgList->m
  Specialised version of `concatMap` from `Foldable` for `CmdArgList`,
since `CmdArgList` cannot implement `Foldable`.

Totality: total
Visibility: export
fromStrList : ListString->CmdArgList
  Function that forms a command line arguments list from a raw list of
strings, treating each string as a single escapable argument.

Totality: total
Visibility: export
recordLineBufferingCmd : Type
  A wrapper for a command list of a shell command which allows to do
line buffering.

Totality: total
Visibility: public export
Constructor: 
MkLineBufferingCmd : CmdArgList->LineBufferingCmd

Projection: 
.lineBufferingCmd : LineBufferingCmd->CmdArgList

Hint: 
Env=>LineBufferingCmd
.lineBufferingCmd : LineBufferingCmd->CmdArgList
Totality: total
Visibility: public export
lineBufferingCmd : LineBufferingCmd->CmdArgList
Totality: total
Visibility: public export
dataLogLevel : Type
  Level used during logging.

Totality: total
Visibility: public export
Constructors:
Debug : LogLevel
Build : LogLevel
Info : LogLevel
Cache : LogLevel
Warning : LogLevel
Silence : LogLevel

Hints:
EqLogLevel
FromTOMLLogLevel
InterpolationLogLevel
OrdLogLevel
logLevels : List (String, LogLevel)
Totality: total
Visibility: export
recordLogRef : Type
  Reference `LogLevel` to be used as an auto implicit

Totality: total
Visibility: public export
Constructor: 
MkLogRef : LogLevel->LogRef

Projection: 
.level : LogRef->LogLevel

Hints:
Config=>LogRef
MetaConfig=>LogRef
.level : LogRef->LogLevel
Totality: total
Visibility: public export
level : LogRef->LogLevel
Totality: total
Visibility: public export
dataTOMLErr : Type
  Error during marshalling from TOML to an Idris type.

Totality: total
Visibility: public export
Constructors:
MissingKey : ListString->TOMLErr
  A mandatory key/value pair in a toml file is
missing
WrongType : ListString->String->TOMLErr
  A value in a toml file has the wrong type
prefixKey : String->EitherTOMLErra->EitherTOMLErra
  Prefix the given TOML key to an error message. This allows us to
specify exactly where in a TOML structure things went wrong.

Totality: total
Visibility: export
dataPackErr : Type
  Errors that can occur when running pack programs.

Totality: total
Visibility: public export
Constructors:
NoCurDir : PackErr
  Failed to get the path of the current directory.
NoPackDir : PackErr
  Failed to get package directory path
NoTmpDir : PackErr
  Failed to create temporary directory
MkDir : PathAbs->FileError->PackErr
  Failed to create the given directory
ReadFile : FileAbs->FileError->PackErr
  Failed to read the given file
WriteFile : FileAbs->FileError->PackErr
  Failed to write to the given file
DirEntries : PathAbs->FileError->PackErr
  Failed to read the content of a directory
Sys : CmdArgList->Int->PackErr
  Error when running the given system command
ChangeDir : PathAbs->PackErr
  Error when changing into the given directory
UnknownPkg : PkgName->PackErr
  The given package is not in the package data base
NotLocalPkg : PkgName->PackErr
  The given package is not a local package
NoApp : PkgName->PackErr
  The given package is not an applicatio
(No executable name set in the `.ipkg` file)
NoAppIpkg : FileAbs->PackErr
  The given package is not an application
(No executable name set in the `.ipkg` file)
InvalidPackageDesc : String->PackErr
  An erroneous package description in a package DB file
EmptyPkgDB : PackErr
  The package database is empty (no header)
InvalidDBHeader : String->PackErr
  Invalid package database header
InvalidDBName : String->PackErr
  Invalid package database header
InvalidPkgType : String->PackErr
  Invalid package type
InvalidPkgVersion : String->PackErr
  Invalid package version
InvalidLogLevel : String->PackErr
  Invalid log level
InvalidIpkgFile : FileAbs->PackErr
  Failed to parse an .ipkg file
InvalidBody : String->PackErr
  Invalid file path body
NoFilePath : String->PackErr
  Failed to parse a file path
MissingCorePackage : PkgName->PkgVersion->Commit->PackErr
  The given core package (base, contrib, etc.)
is missing from the Idris installation.
UnknownArg : String->PackErr
  Unknown command line argument
InvalidArgs : ListString->PackErr
  Invalid command line arguments (in micropack)
ErroneousArg : String->PackErr
  Erroneous command line argument
BuildMany : ListBody->PackErr
  Trying to run zero or more than one local package
(or something that isn't a local package).
UnknownCommand : String->String->PackErr
  Unknown pack command
InvalidCmdArgs : String->ListString->String->PackErr
  Unknown pack command
DirExists : PathAbs->PackErr
  Trying to clone a repository into an existing
directory.
TOMLFile : FileAbs->TOMLErr->PackErr
  Error in a toml file.
TOMLParse : String->PackErr
  Error in a toml file.
BuildFailures : Nat->PackErr
  Number of failures when building packages.
ManualInstallPackApp : PackErr
  User tried to manually install the pack application
SafetyAbort : PackErr
  User aborted installation of a lib/app with custom build hooks.
CyclicDeps : ListPkgName->PackErr
printErr : PackErr->String
  Prints an error that occured during program execution.

Totality: total
Visibility: export
readDBName : String->EitherPackErrDBName
  Tries to convert a string to a `DBName` by first converting
it to a valid file path body.

Totality: total
Visibility: export
readBody : String->EitherPackErrBody
  Tries to convert a string to a file path body.

Totality: total
Visibility: export
readPkgType : String->EitherPackErrPkgType
  Tries to convert a string to a package type.

Totality: total
Visibility: export
readAbsFile : PathAbs->String->EitherPackErr (FileAbs)
  Tries to convert a string representing a relative or absolute
file path. This uses `toAbsPath` internally, so it is somewhat
tolerant w.r.t. to dubious file paths. It fails, however, if the
given path does not contain at least one file path body.

Totality: total
Visibility: export
readLogLevel : String->EitherPackErrLogLevel
Totality: total
Visibility: export