Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Various utilities:
- Spawning of processes in particular environments; see
callProcessInIO
. - Semaphores.
Synopsis
- data ProgPath
- data CallProcess = CP {}
- callProcessInIO :: HasCallStack => Maybe Counter -> CallProcess -> IO ()
- data TempDirPermanence
- withTempDir :: TempDirPermanence -> String -> (FilePath -> IO a) -> IO a
- newtype AbstractSem = AbstractSem {
- withAbstractSem :: forall r. IO r -> IO r
- newAbstractSem :: AsyncSem -> IO AbstractSem
- noSem :: AbstractSem
- abstractQSem :: QSem -> AbstractSem
- splitOn :: Char -> String -> [String]
Call a process in a given environment
The path of a program to run.
data CallProcess Source #
Arguments to callProcess
.
CP | |
|
:: HasCallStack | |
=> Maybe Counter | Optional counter. Used when the command fails, to report the progress that has been made so far. |
-> CallProcess | |
-> IO () |
Run a command and wait for it to complete.
Crashes if the process returns with non-zero exit code.
See CallProcess
for a description of the options.
Create temporary directories
data TempDirPermanence Source #
How to handle deletion of temporary directories.
Instances
Show TempDirPermanence Source # | |
Defined in BuildEnv.Config showsPrec :: Int -> TempDirPermanence -> ShowS # show :: TempDirPermanence -> String # showList :: [TempDirPermanence] -> ShowS # |
:: TempDirPermanence | whether to delete the temporary directory after the action completes |
-> String | directory name template |
-> (FilePath -> IO a) | action to perform |
-> IO a |
Perform an action with a fresh temporary directory.
Abstract semaphores
newtype AbstractSem Source #
Abstract acquire/release mechanism.
AbstractSem | |
|
newAbstractSem :: AsyncSem -> IO AbstractSem Source #
Create a semaphore-based acquire/release mechanism.
noSem :: AbstractSem Source #
No acquire/release mechanism required.
abstractQSem :: QSem -> AbstractSem Source #
Abstract acquire/release mechanism controlled by the given QSem
.