Idris2Doc : Pack.Core.IO

Pack.Core.IO

(source)

Reexports

import public Control.Monad.Either

Definitions

mapMaybeM : Monad m => (a -> (Maybe b `m`)) -> List a -> (List b `m`)
Totality: total
Visibility: export
filterM : Monad m => (a -> (Bool `m`)) -> List a -> (List a `m`)
Totality: total
Visibility: export
ignoreError : Monad m => EitherT err m () -> (() `m`)
Totality: total
Visibility: export
eitherIO : HasIO io => (err -> PackErr) -> io (Either err a) -> EitherT PackErr io a
  Convert an IO action with the potential of failure
to an `EitherT PackErr`.

Totality: total
Visibility: export
finally : Monad m => EitherT err m () -> EitherT err m a -> EitherT err m a
  Make sure a *cleanup* action is run after
an IO action that might fail.

Totality: total
Visibility: export
run : EitherT PackErr IO () -> IO ()
  Runs a *pack* program, printing errors to standard out.

Totality: total
Visibility: export
dispEnv : List EnvVar -> String
  Display a list of variable-value pairs in the format
`VAR1="val1" VAR2="val2"`.

Totality: total
Visibility: export
sys : HasIO io => CmdArgList -> EitherT PackErr io ()
  Tries to run a system command.

Totality: total
Visibility: export
sysAndLog : HasIO io => Env => LogLevel -> CmdArgList -> EitherT PackErr io ()
  Tries to run a system command while logging its output.

Visibility: export
sysWithEnv : HasIO io => CmdArgList -> List EnvVar -> EitherT PackErr io ()
  Tries to run a system command prefixed with the given
environment variables.

Note: In case of an error, the environment will not be part
of the command listed in the error message. This is a
deliberate choice to declutter Idris output in case of a
failed build. If the environment should be included in the
error message, just prefix `cmd` accordingly and use `sys`.

Totality: total
Visibility: export
sysWithEnvAndLog : HasIO io => Env => LogLevel -> CmdArgList -> List EnvVar -> EitherT PackErr io ()
Visibility: export
sysRun : HasIO io => CmdArgList -> EitherT PackErr io String
  Tries to run a system command returning its output.

Visibility: export
sysRunWithEnv : HasIO io => CmdArgList -> List EnvVar -> EitherT PackErr io String
  Tries to run a system command prefixed with the given
environment variables returning its output.

Note: In case of an error, the environment will not be part
of the command listed in the error message. This is a
deliberate choice to declutter Idris output in case of a
failed build. If the environment should be included in the
error message, just prefix `cmd` accordingly and use `sys`.

Visibility: export
exists : HasIO io => Path Abs -> io Bool
  Checks if a file at the given location exists.

Totality: total
Visibility: export
fileExists : HasIO io => File Abs -> io Bool
  Checks if a file at the given location exists.

Totality: total
Visibility: export
missing : HasIO io => Path Abs -> io Bool
  Checks if a file at the given location is missing.

Totality: total
Visibility: export
fileMissing : HasIO io => File Abs -> io Bool
  Checks if a file at the given location is missing.

Totality: total
Visibility: export
mkDir : HasIO io => Path Abs -> EitherT PackErr io ()
  Tries to create a director (including parent directories)

Totality: total
Visibility: export
mkParentDir : HasIO io => Path Abs -> EitherT PackErr io ()
  Creates a parent directory of a (file) path

Totality: total
Visibility: export
rmDir : HasIO io => Path Abs -> EitherT PackErr io ()
  Forcefully deletes a directory with all its content

Totality: total
Visibility: export
curDir : HasIO io => EitherT PackErr io (Path Abs)
  Returns the current directory's path.

Totality: total
Visibility: export
chgDir : HasIO io => Path Abs -> EitherT PackErr io ()
  Changes the working directory

Totality: total
Visibility: export
inDir : HasIO io => Path Abs -> (Path Abs -> EitherT PackErr io a) -> EitherT PackErr io a
  Runs an action in the given directory, changing back
to the current directory afterwards.

Totality: total
Visibility: export
entries : HasIO io => Path Abs -> EitherT PackErr io (List Body)
  Returns the names of entries in a directory

Totality: total
Visibility: export
tomlFiles : HasIO io => Path Abs -> EitherT PackErr io (List Body)
  Returns the names of toml files in a directory

Totality: total
Visibility: export
htmlFiles : HasIO io => Path Abs -> EitherT PackErr io (List Body)
  Returns the names of toml files in a directory

Totality: total
Visibility: export
currentEntries : HasIO io => EitherT PackErr io (List Body)
  Returns the names of entries in the current directory

Totality: total
Visibility: export
copyDir : HasIO io => Path Abs -> Path Abs -> EitherT PackErr io ()
  Copy a directory.

Totality: total
Visibility: export
copyDirInto : HasIO io => Path Abs -> Path Abs -> EitherT PackErr io ()
  Copy a whole directory into the given parent directory.

Totality: total
Visibility: export
findInParentDirs : HasIO io => (Body -> Bool) -> Path Abs -> EitherT PackErr io (Maybe (File Abs))
  Tries to find the first file, the body of which returns `True` for
the given predicate.

Totality: total
Visibility: export
findInAllParentDirs : HasIO io => (Body -> Bool) -> Path Abs -> EitherT PackErr io (List (File Abs))
  Tries to find the first file, the body of which return `True` for
the given predicate, in each parent directory.
Will stop the aggregation at the first encountered `PermissionDenied`.

Totality: total
Visibility: export
withTmpDir : HasIO io => PackDirs => (TmpDir => EitherT PackErr io a) -> EitherT PackErr io a
Totality: total
Visibility: export
rmFile : HasIO io => File Abs -> EitherT PackErr io ()
  Delete a file.

Totality: total
Visibility: export
read : HasIO io => File Abs -> EitherT PackErr io String
  Tries to read the content of a file

Visibility: export
readIfExists : HasIO io => File Abs -> String -> EitherT PackErr io String
  Reads the content of a file if it exists, otherwise
returns the given alternative string.

Visibility: export
write : HasIO io => File Abs -> String -> EitherT PackErr io ()
  Tries to write a string to a file.
The file's parent directory is created if
it does not yet exist.

Visibility: export
  Creates a symbolic link from one path to another,
remove a link at path `to` if there already is one.

Totality: total
Visibility: export
copyFile : HasIO io => File Abs -> File Abs -> EitherT PackErr io ()
  Copy a file.

Totality: total
Visibility: export
patch : HasIO io => File Abs -> File Abs -> EitherT PackErr io ()
  Patch a file

Totality: total
Visibility: export