propellor-5.18: property-based host configuration management in haskell

Safe Haskell | None
Language | Haskell2010

Propellor.Utilities

Description

Re-exports some of propellor's internal utility modules.

These are used in the implementation of propellor, including some of its properties. However, there is no API stability; any of these can change or be removed without a major version number increase.

Use outside propellor at your own risk.

Synopsis

- init :: [a] -> [a]
- last :: [a] -> a
- read :: Read a => String -> a
- head :: [a] -> a
- tail :: [a] -> [a]
- end :: [a] -> [a]
- readish :: Read a => String -> Maybe a
- headMaybe :: [a] -> Maybe a
- lastMaybe :: [a] -> Maybe a
- beginning :: [a] -> [a]
- proc :: FilePath -> [String] -> CreateProcess
- createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- waitForProcess :: ProcessHandle -> IO ExitCode
- data CreateProcess = CreateProcess {
  - cmdspec :: CmdSpec
  - cwd :: Maybe FilePath
  - env :: Maybe [(String, String)]
  - std_in :: StdStream
  - std_out :: StdStream
  - std_err :: StdStream
  - close_fds :: Bool
  - create_group :: Bool
  - delegate_ctlc :: Bool
  - detach_console :: Bool
  - create_new_console :: Bool
  - new_session :: Bool
  - child_group :: Maybe GroupID
  - child_user :: Maybe UserID
  - use_process_jobs :: Bool
  }
- readProcess :: FilePath -> [String] -> IO String
- data StdHandle
  - = StdinHandle
  - | StdoutHandle
  - | StderrHandle
- readProcess' :: CreateProcess -> IO String
- readProcessEnv :: FilePath -> [String] -> Maybe [(String, String)] -> IO String
- writeReadProcessEnv :: FilePath -> [String] -> Maybe [(String, String)] -> Maybe (Handle -> IO ()) -> Maybe (Handle -> IO ()) -> IO String
- forceSuccessProcess :: CreateProcess -> ProcessHandle -> IO ()
- forceSuccessProcess' :: CreateProcess -> ExitCode -> IO ()
- checkSuccessProcess :: ProcessHandle -> IO Bool
- ignoreFailureProcess :: ProcessHandle -> IO Bool
- createProcessSuccess :: CreateProcessRunner
- createProcessChecked :: (ProcessHandle -> IO b) -> CreateProcessRunner
- createBackgroundProcess :: CreateProcessRunner
- withHandle :: StdHandle -> CreateProcessRunner -> CreateProcess -> (Handle -> IO a) -> IO a
- withIOHandles :: CreateProcessRunner -> CreateProcess -> ((Handle, Handle) -> IO a) -> IO a
- withOEHandles :: CreateProcessRunner -> CreateProcess -> ((Handle, Handle) -> IO a) -> IO a
- withNullHandle :: (Handle -> IO a) -> IO a
- withQuietOutput :: CreateProcessRunner -> CreateProcess -> IO ()
- feedWithQuietOutput :: CreateProcessRunner -> CreateProcess -> (Handle -> IO a) -> IO a
- startInteractiveProcess :: FilePath -> [String] -> Maybe [(String, String)] -> IO (ProcessHandle, Handle, Handle)
- stdinHandle :: HandleExtractor
- stdoutHandle :: HandleExtractor
- stderrHandle :: HandleExtractor
- ioHandles :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> (Handle, Handle)
- processHandle :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> ProcessHandle
- devNull :: FilePath
- createPipe :: IO (Handle, Handle)
- data StdStream
  - = Inherit
  - | UseHandle Handle
  - | CreatePipe
  - | NoStream
- data CmdSpec
  - = ShellCommand String
  - | RawCommand FilePath [String]
- data ProcessHandle
- createPipeFd :: IO (FD, FD)
- createProcess_ :: String -> CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- interruptProcessGroupOf :: ProcessHandle -> IO ()
- terminateProcess :: ProcessHandle -> IO ()
- getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode)
- callCommand :: String -> IO ()
- callProcess :: FilePath -> [String] -> IO ()
- cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO ()
- getCurrentPid :: IO Pid
- getPid :: ProcessHandle -> IO (Maybe Pid)
- readCreateProcess :: CreateProcess -> String -> IO String
- readCreateProcessWithExitCode :: CreateProcess -> String -> IO (ExitCode, String, String)
- runCommand :: String -> IO ProcessHandle
- shell :: String -> CreateProcess
- showCommandForUser :: FilePath -> [String] -> String
- spawnCommand :: String -> IO ProcessHandle
- spawnProcess :: FilePath -> [String] -> IO ProcessHandle
- withCreateProcess :: CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> ProcessHandle -> IO a) -> IO a
- type Pid = CPid
- processTranscript :: String -> [String] -> Maybe String -> IO (String, Bool)
- processTranscript' :: CreateProcess -> Maybe String -> IO (String, Bool)
- processTranscript'' :: CreateProcess -> Maybe String -> IO (String, ExitCode)
- class (Typeable e, Show e) => Exception e where
  - toException :: e -> SomeException
  - fromException :: SomeException -> Maybe e
  - displayException :: e -> String
  - backtraceDesired :: e -> Bool
- giveup :: [Char] -> a
- catchBoolIO :: MonadCatch m => m Bool -> m Bool
- catchMaybeIO :: MonadCatch m => m a -> m (Maybe a)
- catchDefaultIO :: MonadCatch m => a -> m a -> m a
- catchMsgIO :: MonadCatch m => m a -> m (Either String a)
- catchIO :: MonadCatch m => m a -> (IOException -> m a) -> m a
- tryIO :: MonadCatch m => m a -> m (Either IOException a)
- bracketIO :: (MonadMask m, MonadIO m) => IO v -> (v -> IO b) -> (v -> m a) -> m a
- catchNonAsync :: MonadCatch m => m a -> (SomeException -> m a) -> m a
- tryNonAsync :: MonadCatch m => m a -> m (Either SomeException a)
- tryWhenExists :: MonadCatch m => m a -> m (Maybe a)
- catchIOErrorType :: MonadCatch m => IOErrorType -> (IOException -> m a) -> m a -> m a
- data IOErrorType
  - = AlreadyExists
  - | NoSuchThing
  - | ResourceBusy
  - | ResourceExhausted
  - | EOF
  - | IllegalOperation
  - | PermissionDenied
  - | UserError
  - | UnsatisfiedConstraints
  - | SystemError
  - | ProtocolError
  - | OtherError
  - | InvalidArgument
  - | InappropriateType
  - | HardwareFault
  - | UnsupportedOperation
  - | TimeExpired
  - | ResourceVanished
  - | Interrupted
- catchPermissionDenied :: MonadCatch m => (IOException -> m a) -> m a -> m a
- catches :: (HasCallStack, Foldable f, MonadCatch m) => m a -> f (Handler m a) -> m a
- bracket :: (HasCallStack, MonadMask m) => m a -> (a -> m c) -> (a -> m b) -> m b
- bracketOnError :: (HasCallStack, MonadMask m) => m a -> (a -> m c) -> (a -> m b) -> m b
- bracket_ :: (HasCallStack, MonadMask m) => m a -> m c -> m b -> m b
- catchJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a
- finally :: (HasCallStack, MonadMask m) => m a -> m b -> m a
- handle :: (HasCallStack, MonadCatch m, Exception e) => (e -> m a) -> m a -> m a
- handleJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a
- onException :: (HasCallStack, MonadCatch m) => m a -> m b -> m a
- try :: (HasCallStack, MonadCatch m, Exception e) => m a -> m (Either e a)
- tryJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)
- class MonadThrow m => MonadCatch (m :: Type -> Type) where
  - catch :: (HasCallStack, Exception e) => m a -> (e -> m a) -> m a
- class MonadCatch m => MonadMask (m :: Type -> Type) where
  - mask :: HasCallStack => ((forall a. m a -> m a) -> m b) -> m b
  - uninterruptibleMask :: HasCallStack => ((forall a. m a -> m a) -> m b) -> m b
  - generalBracket :: HasCallStack => m a -> (a -> ExitCase b -> m c) -> (a -> m b) -> m (b, c)
- mask_ :: (HasCallStack, MonadMask m) => m a -> m a
- uninterruptibleMask_ :: (HasCallStack, MonadMask m) => m a -> m a
- data SomeException = (Exception e, HasExceptionContext) => SomeException e
- class Monad m => MonadThrow (m :: Type -> Type) where
  - throwM :: (HasCallStack, Exception e) => e -> m a
- data ExitCase a
  - = ExitCaseSuccess a
  - | ExitCaseException SomeException
  - | ExitCaseAbort
- catchAll :: (HasCallStack, MonadCatch m) => m a -> (SomeException -> m a) -> m a
- catchIOError :: (HasCallStack, MonadCatch m) => m a -> (IOError -> m a) -> m a
- catchIf :: (HasCallStack, MonadCatch m, Exception e) => (e -> Bool) -> m a -> (e -> m a) -> m a
- handleAll :: (HasCallStack, MonadCatch m) => (SomeException -> m a) -> m a -> m a
- handleIOError :: (HasCallStack, MonadCatch m) => (IOError -> m a) -> m a -> m a
- handleIf :: (HasCallStack, MonadCatch m, Exception e) => (e -> Bool) -> (e -> m a) -> m a -> m a
- onError :: (HasCallStack, MonadMask m) => m a -> m b -> m a
- getEnv :: String -> IO (Maybe String)
- getEnvironment :: IO [(String, String)]
- getEnvDefault :: String -> String -> IO String
- addEntry :: Eq k => k -> v -> [(k, v)] -> [(k, v)]
- delEntry :: Eq k => k -> [(k, v)] -> [(k, v)]
- addEntries :: Eq k => [(k, v)] -> [(k, v)] -> [(k, v)]
- setEnv :: String -> String -> Bool -> IO ()
- unsetEnv :: String -> IO ()
- dirCruft :: FilePath -> Bool
- getTemporaryDirectory :: IO FilePath
- removeFile :: FilePath -> IO ()
- data Permissions
- data XdgDirectory
  - = XdgData
  - | XdgConfig
  - | XdgCache
  - | XdgState
- data XdgDirectoryList
  - = XdgDataDirs
  - | XdgConfigDirs
- canonicalizePath :: FilePath -> IO FilePath
- copyFile :: FilePath -> FilePath -> IO ()
- copyFileWithMetadata :: FilePath -> FilePath -> IO ()
- copyPermissions :: FilePath -> FilePath -> IO ()
- createDirectory :: FilePath -> IO ()
- createDirectoryIfMissing :: Bool -> FilePath -> IO ()
- createDirectoryLink :: FilePath -> FilePath -> IO ()
- createFileLink :: FilePath -> FilePath -> IO ()
- doesDirectoryExist :: FilePath -> IO Bool
- doesFileExist :: FilePath -> IO Bool
- doesPathExist :: FilePath -> IO Bool
- exeExtension :: String
- findExecutable :: String -> IO (Maybe FilePath)
- findExecutables :: String -> IO [FilePath]
- findExecutablesInDirectories :: [FilePath] -> String -> IO [FilePath]
- findFileWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO (Maybe FilePath)
- findFilesWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO [FilePath]
- getAccessTime :: FilePath -> IO UTCTime
- getAppUserDataDirectory :: FilePath -> IO FilePath
- getCurrentDirectory :: IO FilePath
- getDirectoryContents :: FilePath -> IO [FilePath]
- getHomeDirectory :: IO FilePath
- getModificationTime :: FilePath -> IO UTCTime
- getPermissions :: FilePath -> IO Permissions
- getSymbolicLinkTarget :: FilePath -> IO FilePath
- getUserDocumentsDirectory :: IO FilePath
- getXdgDirectory :: XdgDirectory -> FilePath -> IO FilePath
- getXdgDirectoryList :: XdgDirectoryList -> IO [FilePath]
- listDirectory :: FilePath -> IO [FilePath]
- makeAbsolute :: FilePath -> IO FilePath
- makeRelativeToCurrentDirectory :: FilePath -> IO FilePath
- pathIsSymbolicLink :: FilePath -> IO Bool
- removeDirectory :: FilePath -> IO ()
- removeDirectoryLink :: FilePath -> IO ()
- removeDirectoryRecursive :: FilePath -> IO ()
- removePathForcibly :: FilePath -> IO ()
- renameDirectory :: FilePath -> FilePath -> IO ()
- renameFile :: FilePath -> FilePath -> IO ()
- renamePath :: FilePath -> FilePath -> IO ()
- setAccessTime :: FilePath -> UTCTime -> IO ()
- setCurrentDirectory :: FilePath -> IO ()
- setModificationTime :: FilePath -> UTCTime -> IO ()
- setPermissions :: FilePath -> Permissions -> IO ()
- withCurrentDirectory :: FilePath -> IO a -> IO a
- emptyPermissions :: Permissions
- findFile :: [FilePath] -> String -> IO (Maybe FilePath)
- findFiles :: [FilePath] -> String -> IO [FilePath]
- setOwnerExecutable :: Bool -> Permissions -> Permissions
- setOwnerReadable :: Bool -> Permissions -> Permissions
- setOwnerSearchable :: Bool -> Permissions -> Permissions
- setOwnerWritable :: Bool -> Permissions -> Permissions
- dirContents :: FilePath -> IO [FilePath]
- dirContentsRecursive :: FilePath -> IO [FilePath]
- dirContentsRecursiveSkipping :: (FilePath -> Bool) -> Bool -> FilePath -> IO [FilePath]
- dirTreeRecursiveSkipping :: (FilePath -> Bool) -> FilePath -> IO [FilePath]
- moveFile :: FilePath -> FilePath -> IO ()
- nukeFile :: FilePath -> IO ()
- isDirectoryEmpty :: FilePath -> IO Bool
- testDirectory :: FilePath -> (FilePath -> Bool) -> IO Bool
- isUnpopulated :: FilePath -> IO Bool
- fsCruft :: FilePath -> Bool
- type Template = String
- viaTmp :: (MonadMask m, MonadIO m) => (FilePath -> v -> m ()) -> FilePath -> v -> m ()
- withTmpFile :: (MonadIO m, MonadMask m) => Template -> (FilePath -> Handle -> m a) -> m a
- withTmpFileIn :: (MonadIO m, MonadMask m) => FilePath -> Template -> (FilePath -> Handle -> m a) -> m a
- relatedTemplate :: FilePath -> FilePath
- withTmpDir :: (MonadMask m, MonadIO m) => Template -> (FilePath -> m a) -> m a
- removeTmpDir :: MonadIO m => FilePath -> m ()
- withTmpDirIn :: (MonadMask m, MonadIO m) => FilePath -> Template -> (FilePath -> m a) -> m a
- firstM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)
- after :: Monad m => m b -> m a -> m a
- ifM :: Monad m => m Bool -> (m a, m a) -> m a
- getM :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b)
- anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool
- allM :: Monad m => (a -> m Bool) -> [a] -> m Bool
- (<&&>) :: Monad m => m Bool -> m Bool -> m Bool
- untilTrue :: Monad m => [a] -> (a -> m Bool) -> m Bool
- (<||>) :: Monad m => m Bool -> m Bool -> m Bool
- observe :: Monad m => (a -> m b) -> m a -> m a
- noop :: Monad m => m ()
- hGetContentsStrict :: Handle -> IO String
- readFileStrict :: FilePath -> IO String
- separate :: (a -> Bool) -> [a] -> ([a], [a])
- firstLine :: String -> String
- segment :: (a -> Bool) -> [a] -> [[a]]
- prop_segment_regressionTest :: Bool
- segmentDelim :: (a -> Bool) -> [a] -> [[a]]
- massReplace :: [(String, String)] -> String -> String
- hGetSomeString :: Handle -> Int -> IO String
- exitBool :: Bool -> IO a
- type FileMode = CMode
- modifyFileMode :: FilePath -> (FileMode -> FileMode) -> IO ()
- modifyFileMode' :: FilePath -> (FileMode -> FileMode) -> IO FileMode
- withModifiedFileMode :: FilePath -> (FileMode -> FileMode) -> IO a -> IO a
- addModes :: [FileMode] -> FileMode -> FileMode
- combineModes :: [FileMode] -> FileMode
- removeModes :: [FileMode] -> FileMode -> FileMode
- writeModes :: [FileMode]
- readModes :: [FileMode]
- executeModes :: [FileMode]
- otherGroupModes :: [FileMode]
- preventWrite :: FilePath -> IO ()
- allowWrite :: FilePath -> IO ()
- allowRead :: FilePath -> IO ()
- groupSharedModes :: [FileMode]
- groupWriteRead :: FilePath -> IO ()
- checkMode :: FileMode -> FileMode -> Bool
- isSymLink :: FileMode -> Bool
- isExecutable :: FileMode -> Bool
- noUmask :: (MonadIO m, MonadMask m) => FileMode -> m a -> m a
- withUmask :: (MonadIO m, MonadMask m) => FileMode -> m a -> m a
- getUmask :: IO FileMode
- defaultFileMode :: IO FileMode
- isSticky :: FileMode -> Bool
- stickyMode :: FileMode
- setSticky :: FilePath -> IO ()
- writeFileProtected :: FilePath -> String -> IO ()
- writeFileProtected' :: FilePath -> (Handle -> IO ()) -> IO ()
- protectedOutput :: IO a -> IO a

# Documentation

init :: [a] -> [a] Source #

last :: [a] -> a Source #

read :: Read a => String -> a Source #

head :: [a] -> a Source #

tail :: [a] -> [a] Source #

end :: [a] -> [a] Source #

readish :: Read a => String -> Maybe a Source #

headMaybe :: [a] -> Maybe a Source #

lastMaybe :: [a] -> Maybe a Source #

beginning :: [a] -> [a] Source #

proc :: FilePath -> [String] -> CreateProcess #

createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) Source #

Wrapper around `createProcess` that does debug logging.

waitForProcess :: ProcessHandle -> IO ExitCode Source #

Wrapper around `waitForProcess` that does debug logging.

data CreateProcess #

Constructors

CreateProcess |

Fields

- cmdspec :: CmdSpec
- cwd :: Maybe FilePath
- env :: Maybe [(String, String)]
- std_in :: StdStream
- std_out :: StdStream
- std_err :: StdStream
- close_fds :: Bool
- create_group :: Bool
- delegate_ctlc :: Bool
- detach_console :: Bool
- create_new_console :: Bool
- new_session :: Bool
- child_group :: Maybe GroupID
- child_user :: Maybe UserID
- use_process_jobs :: Bool

#### Instances

Instances details

Show CreateProcess |
Instance details Defined in System.Process.Common Methods showsPrec :: Int -> CreateProcess -> ShowS show :: CreateProcess -> String showList :: [CreateProcess] -> ShowS
Eq CreateProcess |
Instance details Defined in System.Process.Common Methods (==) :: CreateProcess -> CreateProcess -> Bool (/=) :: CreateProcess -> CreateProcess -> Bool

readProcess :: FilePath -> [String] -> IO String Source #

Normally, when reading from a process, it does not need to be fed any standard input.

data StdHandle Source #

Constructors

StdinHandle |
StdoutHandle |
StderrHandle |

#### Instances

Instances details

Eq StdHandle Source # |
Instance details Defined in Utility.Process Methods (==) :: StdHandle -> StdHandle -> Bool (/=) :: StdHandle -> StdHandle -> Bool

readProcess' :: CreateProcess -> IO String Source #

readProcessEnv :: FilePath -> [String] -> Maybe [(String, String)] -> IO String Source #

writeReadProcessEnv :: FilePath -> [String] -> Maybe [(String, String)] -> Maybe (Handle -> IO ()) -> Maybe (Handle -> IO ()) -> IO String Source #

Runs an action to write to a process on its stdin, returns its output, and also allows specifying the environment.

forceSuccessProcess :: CreateProcess -> ProcessHandle -> IO () Source #

Waits for a ProcessHandle, and throws an IOError if the process did not exit successfully.

forceSuccessProcess' :: CreateProcess -> ExitCode -> IO () Source #

checkSuccessProcess :: ProcessHandle -> IO Bool Source #

Waits for a ProcessHandle and returns True if it exited successfully. Note that using this with createProcessChecked will throw away the Bool, and is only useful to ignore the exit code of a process, while still waiting for it. -}

ignoreFailureProcess :: ProcessHandle -> IO Bool Source #

createProcessSuccess :: CreateProcessRunner Source #

Runs createProcess, then an action on its handles, and then forceSuccessProcess.

createProcessChecked :: (ProcessHandle -> IO b) -> CreateProcessRunner Source #

Runs createProcess, then an action on its handles, and then a checker action on its exit code, which must wait for the process.

createBackgroundProcess :: CreateProcessRunner Source #

Leaves the process running, suitable for lazy streaming. Note: Zombies will result, and must be waited on.

withHandle :: StdHandle -> CreateProcessRunner -> CreateProcess -> (Handle -> IO a) -> IO a Source #

Runs a CreateProcessRunner, on a CreateProcess structure, that is adjusted to pipe only from/to a single StdHandle, and passes the resulting Handle to an action.

withIOHandles :: CreateProcessRunner -> CreateProcess -> ((Handle, Handle) -> IO a) -> IO a Source #

Like withHandle, but passes (stdin, stdout) handles to the action.

withOEHandles :: CreateProcessRunner -> CreateProcess -> ((Handle, Handle) -> IO a) -> IO a Source #

Like withHandle, but passes (stdout, stderr) handles to the action.

withNullHandle :: (Handle -> IO a) -> IO a Source #

withQuietOutput :: CreateProcessRunner -> CreateProcess -> IO () Source #

Forces the CreateProcessRunner to run quietly; both stdout and stderr are discarded.

feedWithQuietOutput :: CreateProcessRunner -> CreateProcess -> (Handle -> IO a) -> IO a Source #

Stdout and stderr are discarded, while the process is fed stdin from the handle.

startInteractiveProcess :: FilePath -> [String] -> Maybe [(String, String)] -> IO (ProcessHandle, Handle, Handle) Source #

Starts an interactive process. Unlike runInteractiveProcess in System.Process, stderr is inherited.

stdinHandle :: HandleExtractor Source #

stdoutHandle :: HandleExtractor Source #

stderrHandle :: HandleExtractor Source #

ioHandles :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> (Handle, Handle) Source #

processHandle :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> ProcessHandle Source #

devNull :: FilePath Source #

createPipe :: IO (Handle, Handle) #

data StdStream #

Constructors

Inherit |
UseHandle Handle |
CreatePipe |
NoStream |

#### Instances

Instances details

Show StdStream |
Instance details Defined in System.Process.Common Methods showsPrec :: Int -> StdStream -> ShowS show :: StdStream -> String showList :: [StdStream] -> ShowS
Eq StdStream |
Instance details Defined in System.Process.Common Methods (==) :: StdStream -> StdStream -> Bool (/=) :: StdStream -> StdStream -> Bool

data CmdSpec #

Constructors

ShellCommand String |
RawCommand FilePath [String] |

#### Instances

Instances details

IsString CmdSpec |
Instance details Defined in System.Process.Common Methods fromString :: String -> CmdSpec #
Show CmdSpec |
Instance details Defined in System.Process.Common Methods showsPrec :: Int -> CmdSpec -> ShowS show :: CmdSpec -> String showList :: [CmdSpec] -> ShowS
Eq CmdSpec |
Instance details Defined in System.Process.Common Methods (==) :: CmdSpec -> CmdSpec -> Bool (/=) :: CmdSpec -> CmdSpec -> Bool

data ProcessHandle #

createPipeFd :: IO (FD, FD) #

createProcess_ :: String -> CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) #

interruptProcessGroupOf :: ProcessHandle -> IO () #

terminateProcess :: ProcessHandle -> IO () #

getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode) #

callCommand :: String -> IO () #

callProcess :: FilePath -> [String] -> IO () #

cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO () #

getCurrentPid :: IO Pid #

getPid :: ProcessHandle -> IO (Maybe Pid) #

readCreateProcess :: CreateProcess -> String -> IO String #

readCreateProcessWithExitCode :: CreateProcess -> String -> IO (ExitCode, String, String) #

runCommand :: String -> IO ProcessHandle #

shell :: String -> CreateProcess #

showCommandForUser :: FilePath -> [String] -> String #

spawnCommand :: String -> IO ProcessHandle #

spawnProcess :: FilePath -> [String] -> IO ProcessHandle #

withCreateProcess :: CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> ProcessHandle -> IO a) -> IO a #

type Pid = CPid #

processTranscript :: String -> [String] -> Maybe String -> IO (String, Bool) Source #

Runs a process and returns a transcript combining its stdout and stderr, and whether it succeeded or failed.

processTranscript' :: CreateProcess -> Maybe String -> IO (String, Bool) Source #

Also feeds the process some input.

processTranscript'' :: CreateProcess -> Maybe String -> IO (String, ExitCode) Source #

class (Typeable e, Show e) => Exception e where #

Minimal complete definition

Nothing

Methods

toException :: e -> SomeException #

fromException :: SomeException -> Maybe e #

displayException :: e -> String #

backtraceDesired :: e -> Bool #

#### Instances

Instances details

Exception AsyncCancelled |
Instance details Defined in Control.Concurrent.Async.Internal Methods toException :: AsyncCancelled -> SomeException # fromException :: SomeException -> Maybe AsyncCancelled # displayException :: AsyncCancelled -> String # backtraceDesired :: AsyncCancelled -> Bool #
Exception ExceptionInLinkedThread |
Instance details Defined in Control.Concurrent.Async.Internal Methods toException :: ExceptionInLinkedThread -> SomeException # fromException :: SomeException -> Maybe ExceptionInLinkedThread # displayException :: ExceptionInLinkedThread -> String # backtraceDesired :: ExceptionInLinkedThread -> Bool #
Exception Timeout |
Instance details Defined in System.Timeout Methods toException :: Timeout -> SomeException # fromException :: SomeException -> Maybe Timeout # displayException :: Timeout -> String # backtraceDesired :: Timeout -> Bool #
Exception SizeOverflowException |
Instance details Defined in Data.ByteString.Internal.Type Methods toException :: SizeOverflowException -> SomeException # fromException :: SomeException -> Maybe SizeOverflowException # displayException :: SizeOverflowException -> String # backtraceDesired :: SizeOverflowException -> Bool #
Exception Void |
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String # backtraceDesired :: Void -> Bool #
Exception ErrorCall |
Instance details Defined in GHC.Internal.Exception Methods toException :: ErrorCall -> SomeException # fromException :: SomeException -> Maybe ErrorCall # displayException :: ErrorCall -> String # backtraceDesired :: ErrorCall -> Bool #
Exception ArithException |
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: ArithException -> SomeException # fromException :: SomeException -> Maybe ArithException # displayException :: ArithException -> String # backtraceDesired :: ArithException -> Bool #
Exception SomeException |
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # backtraceDesired :: SomeException -> Bool #
Exception AllocationLimitExceeded |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: AllocationLimitExceeded -> SomeException # fromException :: SomeException -> Maybe AllocationLimitExceeded # displayException :: AllocationLimitExceeded -> String # backtraceDesired :: AllocationLimitExceeded -> Bool #
Exception ArrayException |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: ArrayException -> SomeException # fromException :: SomeException -> Maybe ArrayException # displayException :: ArrayException -> String # backtraceDesired :: ArrayException -> Bool #
Exception AssertionFailed |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: AssertionFailed -> SomeException # fromException :: SomeException -> Maybe AssertionFailed # displayException :: AssertionFailed -> String # backtraceDesired :: AssertionFailed -> Bool #
Exception AsyncException |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: AsyncException -> SomeException # fromException :: SomeException -> Maybe AsyncException # displayException :: AsyncException -> String # backtraceDesired :: AsyncException -> Bool #
Exception BlockedIndefinitelyOnMVar |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: BlockedIndefinitelyOnMVar -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnMVar # displayException :: BlockedIndefinitelyOnMVar -> String # backtraceDesired :: BlockedIndefinitelyOnMVar -> Bool #
Exception BlockedIndefinitelyOnSTM |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: BlockedIndefinitelyOnSTM -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnSTM # displayException :: BlockedIndefinitelyOnSTM -> String # backtraceDesired :: BlockedIndefinitelyOnSTM -> Bool #
Exception CompactionFailed |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: CompactionFailed -> SomeException # fromException :: SomeException -> Maybe CompactionFailed # displayException :: CompactionFailed -> String # backtraceDesired :: CompactionFailed -> Bool #
Exception Deadlock |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: Deadlock -> SomeException # fromException :: SomeException -> Maybe Deadlock # displayException :: Deadlock -> String # backtraceDesired :: Deadlock -> Bool #
Exception ExitCode |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: ExitCode -> SomeException # fromException :: SomeException -> Maybe ExitCode # displayException :: ExitCode -> String # backtraceDesired :: ExitCode -> Bool #
Exception FixIOException |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: FixIOException -> SomeException # fromException :: SomeException -> Maybe FixIOException # displayException :: FixIOException -> String # backtraceDesired :: FixIOException -> Bool #
Exception IOException |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String # backtraceDesired :: IOException -> Bool #
Exception SomeAsyncException |
Instance details Defined in GHC.Internal.IO.Exception Methods toException :: SomeAsyncException -> SomeException # fromException :: SomeException -> Maybe SomeAsyncException # displayException :: SomeAsyncException -> String # backtraceDesired :: SomeAsyncException -> Bool #
Exception StopPropellorException Source # |
Instance details Defined in Propellor.Types.Exception Methods toException :: StopPropellorException -> SomeException # fromException :: SomeException -> Maybe StopPropellorException # displayException :: StopPropellorException -> String # backtraceDesired :: StopPropellorException -> Bool #
Exception UnicodeException |
Instance details Defined in Data.Text.Encoding.Error Methods toException :: UnicodeException -> SomeException # fromException :: SomeException -> Maybe UnicodeException # displayException :: UnicodeException -> String # backtraceDesired :: UnicodeException -> Bool #
Exception a => Exception (ExceptionWithContext a) |
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: ExceptionWithContext a -> SomeException # fromException :: SomeException -> Maybe (ExceptionWithContext a) # displayException :: ExceptionWithContext a -> String # backtraceDesired :: ExceptionWithContext a -> Bool #
Exception e => Exception (NoBacktrace e) |
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: NoBacktrace e -> SomeException # fromException :: SomeException -> Maybe (NoBacktrace e) # displayException :: NoBacktrace e -> String # backtraceDesired :: NoBacktrace e -> Bool #

giveup :: [Char] -> a Source #

catchBoolIO :: MonadCatch m => m Bool -> m Bool Source #

catchMaybeIO :: MonadCatch m => m a -> m (Maybe a) Source #

catchDefaultIO :: MonadCatch m => a -> m a -> m a Source #

catchMsgIO :: MonadCatch m => m a -> m (Either String a) Source #

catchIO :: MonadCatch m => m a -> (IOException -> m a) -> m a Source #

tryIO :: MonadCatch m => m a -> m (Either IOException a) Source #

bracketIO :: (MonadMask m, MonadIO m) => IO v -> (v -> IO b) -> (v -> m a) -> m a Source #

catchNonAsync :: MonadCatch m => m a -> (SomeException -> m a) -> m a Source #

tryNonAsync :: MonadCatch m => m a -> m (Either SomeException a) Source #

tryWhenExists :: MonadCatch m => m a -> m (Maybe a) Source #

catchIOErrorType :: MonadCatch m => IOErrorType -> (IOException -> m a) -> m a -> m a Source #

data IOErrorType #

Constructors

AlreadyExists |
NoSuchThing |
ResourceBusy |
ResourceExhausted |
EOF |
IllegalOperation |
PermissionDenied |
UserError |
UnsatisfiedConstraints |
SystemError |
ProtocolError |
OtherError |
InvalidArgument |
InappropriateType |
HardwareFault |
UnsupportedOperation |
TimeExpired |
ResourceVanished |
Interrupted |

#### Instances

Instances details

Show IOErrorType |
Instance details Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS show :: IOErrorType -> String showList :: [IOErrorType] -> ShowS
Eq IOErrorType |
Instance details Defined in GHC.Internal.IO.Exception Methods (==) :: IOErrorType -> IOErrorType -> Bool (/=) :: IOErrorType -> IOErrorType -> Bool

catchPermissionDenied :: MonadCatch m => (IOException -> m a) -> m a -> m a Source #

catches :: (HasCallStack, Foldable f, MonadCatch m) => m a -> f (Handler m a) -> m a #

bracket :: (HasCallStack, MonadMask m) => m a -> (a -> m c) -> (a -> m b) -> m b #

bracketOnError :: (HasCallStack, MonadMask m) => m a -> (a -> m c) -> (a -> m b) -> m b #

bracket_ :: (HasCallStack, MonadMask m) => m a -> m c -> m b -> m b #

catchJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a #

finally :: (HasCallStack, MonadMask m) => m a -> m b -> m a #

handle :: (HasCallStack, MonadCatch m, Exception e) => (e -> m a) -> m a -> m a #

handleJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a #

onException :: (HasCallStack, MonadCatch m) => m a -> m b -> m a #

try :: (HasCallStack, MonadCatch m, Exception e) => m a -> m (Either e a) #

tryJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a) #

class MonadThrow m => MonadCatch (m :: Type -> Type) where #

Methods

catch :: (HasCallStack, Exception e) => m a -> (e -> m a) -> m a #

#### Instances

Instances details

MonadCatch STM |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => STM a -> (e -> STM a) -> STM a #
MonadCatch IO |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => IO a -> (e -> IO a) -> IO a #
MonadCatch Propellor Source # |
Instance details Defined in Propellor.Types.Core Methods catch :: (HasCallStack, Exception e) => Propellor a -> (e -> Propellor a) -> Propellor a #
Monad m => MonadCatch (CatchT m) |
Instance details Defined in Control.Monad.Catch.Pure Methods catch :: (HasCallStack, Exception e) => CatchT m a -> (e -> CatchT m a) -> CatchT m a #
e ~ SomeException => MonadCatch (Either e) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e0) => Either e a -> (e0 -> Either e a) -> Either e a #
MonadCatch m => MonadCatch (MaybeT m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => MaybeT m a -> (e -> MaybeT m a) -> MaybeT m a #
MonadCatch m => MonadCatch (ExceptT e m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e0) => ExceptT e m a -> (e0 -> ExceptT e m a) -> ExceptT e m a #
MonadCatch m => MonadCatch (IdentityT m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => IdentityT m a -> (e -> IdentityT m a) -> IdentityT m a #
MonadCatch m => MonadCatch (ReaderT r m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => ReaderT r m a -> (e -> ReaderT r m a) -> ReaderT r m a #
MonadCatch m => MonadCatch (StateT s m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => StateT s m a -> (e -> StateT s m a) -> StateT s m a #
MonadCatch m => MonadCatch (StateT s m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => StateT s m a -> (e -> StateT s m a) -> StateT s m a #
(MonadCatch m, Monoid w) => MonadCatch (WriterT w m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => WriterT w m a -> (e -> WriterT w m a) -> WriterT w m a #
(MonadCatch m, Monoid w) => MonadCatch (WriterT w m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => WriterT w m a -> (e -> WriterT w m a) -> WriterT w m a #
(MonadCatch m, Monoid w) => MonadCatch (RWST r w s m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => RWST r w s m a -> (e -> RWST r w s m a) -> RWST r w s m a #
(MonadCatch m, Monoid w) => MonadCatch (RWST r w s m) |
Instance details Defined in Control.Monad.Catch Methods catch :: (HasCallStack, Exception e) => RWST r w s m a -> (e -> RWST r w s m a) -> RWST r w s m a #

class MonadCatch m => MonadMask (m :: Type -> Type) where #

Methods

mask :: HasCallStack => ((forall a. m a -> m a) -> m b) -> m b #

uninterruptibleMask :: HasCallStack => ((forall a. m a -> m a) -> m b) -> m b #

generalBracket :: HasCallStack => m a -> (a -> ExitCase b -> m c) -> (a -> m b) -> m (b, c) #

#### Instances

Instances details

MonadMask IO |
Instance details Defined in Control.Monad.Catch Methods mask :: HasCallStack => ((forall a. IO a -> IO a) -> IO b) -> IO b # uninterruptibleMask :: HasCallStack => ((forall a. IO a -> IO a) -> IO b) -> IO b # generalBracket :: HasCallStack => IO a -> (a -> ExitCase b -> IO c) -> (a -> IO b) -> IO (b, c) #
MonadMask Propellor Source # |
Instance details Defined in Propellor.Types.Core Methods mask :: HasCallStack => ((forall a. Propellor a -> Propellor a) -> Propellor b) -> Propellor b # uninterruptibleMask :: HasCallStack => ((forall a. Propellor a -> Propellor a) -> Propellor b) -> Propellor b # generalBracket :: HasCallStack => Propellor a -> (a -> ExitCase b -> Propellor c) -> (a -> Propellor b) -> Propellor (b, c) #
Monad m => MonadMask (CatchT m) |
Instance details Defined in Control.Monad.Catch.Pure Methods mask :: HasCallStack => ((forall a. CatchT m a -> CatchT m a) -> CatchT m b) -> CatchT m b # uninterruptibleMask :: HasCallStack => ((forall a. CatchT m a -> CatchT m a) -> CatchT m b) -> CatchT m b # generalBracket :: HasCallStack => CatchT m a -> (a -> ExitCase b -> CatchT m c) -> (a -> CatchT m b) -> CatchT m (b, c) #
e ~ SomeException => MonadMask (Either e) |
Instance details Defined in Control.Monad.Catch Methods mask :: HasCallStack => ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b # uninterruptibleMask :: HasCallStack => ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b # generalBracket :: HasCallStack => Either e a -> (a -> ExitCase b -> Either e c) -> (a -> Either e b) -> Either e (b, c) #
MonadMask m => MonadMask (MaybeT m) |
Instance details Defined in Control.Monad.Catch Methods mask :: HasCallStack => ((forall a. MaybeT m a -> MaybeT m a) -> MaybeT m b) -> MaybeT m b # uninterruptibleMask :: HasCallStack => ((forall a. MaybeT m a -> MaybeT m a) -> MaybeT m b) -> MaybeT m b # generalBracket :: HasCallStack => MaybeT m a -> (a -> ExitCase b -> MaybeT m c) -> (a -> MaybeT m b) -> MaybeT m (b, c) #
MonadMask m => MonadMask (ExceptT e m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. ExceptT e m a -> ExceptT e m a) -> ExceptT e m b) -> ExceptT e m b #

uninterruptibleMask :: HasCallStack => ((forall a. ExceptT e m a -> ExceptT e m a) -> ExceptT e m b) -> ExceptT e m b #

generalBracket :: HasCallStack => ExceptT e m a -> (a -> ExitCase b -> ExceptT e m c) -> (a -> ExceptT e m b) -> ExceptT e m (b, c) #

MonadMask m => MonadMask (IdentityT m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. IdentityT m a -> IdentityT m a) -> IdentityT m b) -> IdentityT m b #

uninterruptibleMask :: HasCallStack => ((forall a. IdentityT m a -> IdentityT m a) -> IdentityT m b) -> IdentityT m b #

generalBracket :: HasCallStack => IdentityT m a -> (a -> ExitCase b -> IdentityT m c) -> (a -> IdentityT m b) -> IdentityT m (b, c) #

MonadMask m => MonadMask (ReaderT r m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. ReaderT r m a -> ReaderT r m a) -> ReaderT r m b) -> ReaderT r m b #

uninterruptibleMask :: HasCallStack => ((forall a. ReaderT r m a -> ReaderT r m a) -> ReaderT r m b) -> ReaderT r m b #

generalBracket :: HasCallStack => ReaderT r m a -> (a -> ExitCase b -> ReaderT r m c) -> (a -> ReaderT r m b) -> ReaderT r m (b, c) #

MonadMask m => MonadMask (StateT s m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

uninterruptibleMask :: HasCallStack => ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

generalBracket :: HasCallStack => StateT s m a -> (a -> ExitCase b -> StateT s m c) -> (a -> StateT s m b) -> StateT s m (b, c) #

MonadMask m => MonadMask (StateT s m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

uninterruptibleMask :: HasCallStack => ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

generalBracket :: HasCallStack => StateT s m a -> (a -> ExitCase b -> StateT s m c) -> (a -> StateT s m b) -> StateT s m (b, c) #

(MonadMask m, Monoid w) => MonadMask (WriterT w m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

uninterruptibleMask :: HasCallStack => ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

generalBracket :: HasCallStack => WriterT w m a -> (a -> ExitCase b -> WriterT w m c) -> (a -> WriterT w m b) -> WriterT w m (b, c) #

(MonadMask m, Monoid w) => MonadMask (WriterT w m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

uninterruptibleMask :: HasCallStack => ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

generalBracket :: HasCallStack => WriterT w m a -> (a -> ExitCase b -> WriterT w m c) -> (a -> WriterT w m b) -> WriterT w m (b, c) #

(MonadMask m, Monoid w) => MonadMask (RWST r w s m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

uninterruptibleMask :: HasCallStack => ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

generalBracket :: HasCallStack => RWST r w s m a -> (a -> ExitCase b -> RWST r w s m c) -> (a -> RWST r w s m b) -> RWST r w s m (b, c) #

(MonadMask m, Monoid w) => MonadMask (RWST r w s m) |

Instance details

Defined in Control.Monad.Catch

Methods

mask :: HasCallStack => ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

uninterruptibleMask :: HasCallStack => ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

generalBracket :: HasCallStack => RWST r w s m a -> (a -> ExitCase b -> RWST r w s m c) -> (a -> RWST r w s m b) -> RWST r w s m (b, c) #

mask_ :: (HasCallStack, MonadMask m) => m a -> m a #

uninterruptibleMask_ :: (HasCallStack, MonadMask m) => m a -> m a #

data SomeException #

Constructors

(Exception e, HasExceptionContext) => SomeException e |

#### Instances

Instances details

Exception SomeException |
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # backtraceDesired :: SomeException -> Bool #
Show SomeException |
Instance details Defined in GHC.Internal.Exception.Type Methods showsPrec :: Int -> SomeException -> ShowS show :: SomeException -> String showList :: [SomeException] -> ShowS

class Monad m => MonadThrow (m :: Type -> Type) where #

Methods

throwM :: (HasCallStack, Exception e) => e -> m a #

#### Instances

Instances details

MonadThrow STM |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> STM a #
MonadThrow IO |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> IO a #
MonadThrow Propellor Source # |
Instance details Defined in Propellor.Types.Core Methods throwM :: (HasCallStack, Exception e) => e -> Propellor a #
MonadThrow Q |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> Q a #
MonadThrow Maybe |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> Maybe a #
MonadThrow [] |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> [a] #
Monad m => MonadThrow (CatchT m) |
Instance details Defined in Control.Monad.Catch.Pure Methods throwM :: (HasCallStack, Exception e) => e -> CatchT m a #
e ~ SomeException => MonadThrow (Either e) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e0) => e0 -> Either e a #
MonadThrow (ST s) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> ST s a #
MonadThrow m => MonadThrow (MaybeT m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> MaybeT m a #
MonadThrow m => MonadThrow (ExceptT e m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e0) => e0 -> ExceptT e m a #
MonadThrow m => MonadThrow (IdentityT m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> IdentityT m a #
MonadThrow m => MonadThrow (ReaderT r m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> ReaderT r m a #
MonadThrow m => MonadThrow (StateT s m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> StateT s m a #
MonadThrow m => MonadThrow (StateT s m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> StateT s m a #
(MonadThrow m, Monoid w) => MonadThrow (WriterT w m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> WriterT w m a #
(MonadThrow m, Monoid w) => MonadThrow (WriterT w m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> WriterT w m a #
MonadThrow m => MonadThrow (ContT r m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> ContT r m a #
(MonadThrow m, Monoid w) => MonadThrow (RWST r w s m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> RWST r w s m a #
(MonadThrow m, Monoid w) => MonadThrow (RWST r w s m) |
Instance details Defined in Control.Monad.Catch Methods throwM :: (HasCallStack, Exception e) => e -> RWST r w s m a #

data ExitCase a #

Constructors

ExitCaseSuccess a |
ExitCaseException SomeException |
ExitCaseAbort |

#### Instances

Instances details

Show a => Show (ExitCase a) |
Instance details Defined in Control.Monad.Catch Methods showsPrec :: Int -> ExitCase a -> ShowS show :: ExitCase a -> String showList :: [ExitCase a] -> ShowS

catchAll :: (HasCallStack, MonadCatch m) => m a -> (SomeException -> m a) -> m a #

catchIOError :: (HasCallStack, MonadCatch m) => m a -> (IOError -> m a) -> m a #

catchIf :: (HasCallStack, MonadCatch m, Exception e) => (e -> Bool) -> m a -> (e -> m a) -> m a #

handleAll :: (HasCallStack, MonadCatch m) => (SomeException -> m a) -> m a -> m a #

handleIOError :: (HasCallStack, MonadCatch m) => (IOError -> m a) -> m a -> m a #

handleIf :: (HasCallStack, MonadCatch m, Exception e) => (e -> Bool) -> (e -> m a) -> m a -> m a #

onError :: (HasCallStack, MonadMask m) => m a -> m b -> m a #

getEnv :: String -> IO (Maybe String) Source #

getEnvironment :: IO [(String, String)] Source #

getEnvDefault :: String -> String -> IO String Source #

addEntry :: Eq k => k -> v -> [(k, v)] -> [(k, v)] Source #

delEntry :: Eq k => k -> [(k, v)] -> [(k, v)] Source #

addEntries :: Eq k => [(k, v)] -> [(k, v)] -> [(k, v)] Source #

setEnv :: String -> String -> Bool -> IO () Source #

unsetEnv :: String -> IO () Source #

dirCruft :: FilePath -> Bool Source #

getTemporaryDirectory :: IO FilePath #

removeFile :: FilePath -> IO () #

data Permissions #

#### Instances

Instances details

Read Permissions |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS Permissions readList :: ReadS [Permissions] readPrec :: ReadPrec Permissions readListPrec :: ReadPrec [Permissions]
Show Permissions |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> Permissions -> ShowS show :: Permissions -> String showList :: [Permissions] -> ShowS
Eq Permissions |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: Permissions -> Permissions -> Bool (/=) :: Permissions -> Permissions -> Bool
Ord Permissions |
Instance details Defined in System.Directory.Internal.Common Methods compare :: Permissions -> Permissions -> Ordering (<) :: Permissions -> Permissions -> Bool (<=) :: Permissions -> Permissions -> Bool (>) :: Permissions -> Permissions -> Bool (>=) :: Permissions -> Permissions -> Bool max :: Permissions -> Permissions -> Permissions min :: Permissions -> Permissions -> Permissions

data XdgDirectory #

Constructors

XdgData |
XdgConfig |
XdgCache |
XdgState |

#### Instances

Instances details

Bounded XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectory maxBound :: XdgDirectory
Enum XdgDirectory |

Instance details

Defined in System.Directory.Internal.Common

Methods

succ :: XdgDirectory -> XdgDirectory

pred :: XdgDirectory -> XdgDirectory

toEnum :: Int -> XdgDirectory

fromEnum :: XdgDirectory -> Int

enumFrom :: XdgDirectory -> [XdgDirectory]

enumFromThen :: XdgDirectory -> XdgDirectory -> [XdgDirectory]

enumFromTo :: XdgDirectory -> XdgDirectory -> [XdgDirectory]

enumFromThenTo :: XdgDirectory -> XdgDirectory -> XdgDirectory -> [XdgDirectory]

Read XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectory readList :: ReadS [XdgDirectory] readPrec :: ReadPrec XdgDirectory readListPrec :: ReadPrec [XdgDirectory]
Show XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectory -> ShowS show :: XdgDirectory -> String showList :: [XdgDirectory] -> ShowS
Eq XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectory -> XdgDirectory -> Bool (/=) :: XdgDirectory -> XdgDirectory -> Bool
Ord XdgDirectory |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectory -> XdgDirectory -> Ordering

(<) :: XdgDirectory -> XdgDirectory -> Bool

(<=) :: XdgDirectory -> XdgDirectory -> Bool

(>) :: XdgDirectory -> XdgDirectory -> Bool

(>=) :: XdgDirectory -> XdgDirectory -> Bool

max :: XdgDirectory -> XdgDirectory -> XdgDirectory

min :: XdgDirectory -> XdgDirectory -> XdgDirectory

data XdgDirectoryList #

Constructors

XdgDataDirs |
XdgConfigDirs |

#### Instances

Instances details

Bounded XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectoryList maxBound :: XdgDirectoryList
Enum XdgDirectoryList |

Instance details

Defined in System.Directory.Internal.Common

Methods

succ :: XdgDirectoryList -> XdgDirectoryList

pred :: XdgDirectoryList -> XdgDirectoryList

toEnum :: Int -> XdgDirectoryList

fromEnum :: XdgDirectoryList -> Int

enumFrom :: XdgDirectoryList -> [XdgDirectoryList]

enumFromThen :: XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList]

enumFromTo :: XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList]

enumFromThenTo :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList]

Read XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectoryList readList :: ReadS [XdgDirectoryList] readPrec :: ReadPrec XdgDirectoryList readListPrec :: ReadPrec [XdgDirectoryList]
Show XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectoryList -> ShowS show :: XdgDirectoryList -> String showList :: [XdgDirectoryList] -> ShowS
Eq XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectoryList -> XdgDirectoryList -> Bool (/=) :: XdgDirectoryList -> XdgDirectoryList -> Bool
Ord XdgDirectoryList |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectoryList -> XdgDirectoryList -> Ordering

(<) :: XdgDirectoryList -> XdgDirectoryList -> Bool

(<=) :: XdgDirectoryList -> XdgDirectoryList -> Bool

(>) :: XdgDirectoryList -> XdgDirectoryList -> Bool

(>=) :: XdgDirectoryList -> XdgDirectoryList -> Bool

max :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList

min :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList

canonicalizePath :: FilePath -> IO FilePath #

copyFile :: FilePath -> FilePath -> IO () #

copyFileWithMetadata :: FilePath -> FilePath -> IO () #

copyPermissions :: FilePath -> FilePath -> IO () #

createDirectory :: FilePath -> IO () #

createDirectoryIfMissing :: Bool -> FilePath -> IO () #

createDirectoryLink :: FilePath -> FilePath -> IO () #

createFileLink :: FilePath -> FilePath -> IO () #

doesDirectoryExist :: FilePath -> IO Bool #

doesFileExist :: FilePath -> IO Bool #

doesPathExist :: FilePath -> IO Bool #

exeExtension :: String #

findExecutable :: String -> IO (Maybe FilePath) #

findExecutables :: String -> IO [FilePath] #

findExecutablesInDirectories :: [FilePath] -> String -> IO [FilePath] #

findFileWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO (Maybe FilePath) #

findFilesWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO [FilePath] #

getAccessTime :: FilePath -> IO UTCTime #

getAppUserDataDirectory :: FilePath -> IO FilePath #

getCurrentDirectory :: IO FilePath #

getDirectoryContents :: FilePath -> IO [FilePath] #

getHomeDirectory :: IO FilePath #

getModificationTime :: FilePath -> IO UTCTime #

getPermissions :: FilePath -> IO Permissions #

getSymbolicLinkTarget :: FilePath -> IO FilePath #

getUserDocumentsDirectory :: IO FilePath #

getXdgDirectory :: XdgDirectory -> FilePath -> IO FilePath #

getXdgDirectoryList :: XdgDirectoryList -> IO [FilePath] #

listDirectory :: FilePath -> IO [FilePath] #

makeAbsolute :: FilePath -> IO FilePath #

makeRelativeToCurrentDirectory :: FilePath -> IO FilePath #

pathIsSymbolicLink :: FilePath -> IO Bool #

removeDirectory :: FilePath -> IO () #

removeDirectoryLink :: FilePath -> IO () #

removeDirectoryRecursive :: FilePath -> IO () #

removePathForcibly :: FilePath -> IO () #

renameDirectory :: FilePath -> FilePath -> IO () #

renameFile :: FilePath -> FilePath -> IO () #

renamePath :: FilePath -> FilePath -> IO () #

setAccessTime :: FilePath -> UTCTime -> IO () #

setCurrentDirectory :: FilePath -> IO () #

setModificationTime :: FilePath -> UTCTime -> IO () #

setPermissions :: FilePath -> Permissions -> IO () #

withCurrentDirectory :: FilePath -> IO a -> IO a #

emptyPermissions :: Permissions #

findFile :: [FilePath] -> String -> IO (Maybe FilePath) #

findFiles :: [FilePath] -> String -> IO [FilePath] #

setOwnerExecutable :: Bool -> Permissions -> Permissions #

setOwnerReadable :: Bool -> Permissions -> Permissions #

setOwnerSearchable :: Bool -> Permissions -> Permissions #

setOwnerWritable :: Bool -> Permissions -> Permissions #

dirContents :: FilePath -> IO [FilePath] Source #

dirContentsRecursive :: FilePath -> IO [FilePath] Source #

dirContentsRecursiveSkipping :: (FilePath -> Bool) -> Bool -> FilePath -> IO [FilePath] Source #

dirTreeRecursiveSkipping :: (FilePath -> Bool) -> FilePath -> IO [FilePath] Source #

moveFile :: FilePath -> FilePath -> IO () Source #

nukeFile :: FilePath -> IO () Source #

isDirectoryEmpty :: FilePath -> IO Bool Source #

True only when directory exists and contains nothing. Throws exception if directory does not exist.

testDirectory :: FilePath -> (FilePath -> Bool) -> IO Bool Source #

Run test on entries found in directory, return False as soon as the test returns False, else return True. Throws exception if directory does not exist.

isUnpopulated :: FilePath -> IO Bool Source #

True if the directory does not exist or contains nothing. Ignores "lost+found" which can exist in an empty filesystem.

fsCruft :: FilePath -> Bool Source #

type Template = String Source #

viaTmp :: (MonadMask m, MonadIO m) => (FilePath -> v -> m ()) -> FilePath -> v -> m () Source #

withTmpFile :: (MonadIO m, MonadMask m) => Template -> (FilePath -> Handle -> m a) -> m a Source #

withTmpFileIn :: (MonadIO m, MonadMask m) => FilePath -> Template -> (FilePath -> Handle -> m a) -> m a Source #

relatedTemplate :: FilePath -> FilePath Source #

withTmpDir :: (MonadMask m, MonadIO m) => Template -> (FilePath -> m a) -> m a Source #

removeTmpDir :: MonadIO m => FilePath -> m () Source #

withTmpDirIn :: (MonadMask m, MonadIO m) => FilePath -> Template -> (FilePath -> m a) -> m a Source #

firstM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a) Source #

after :: Monad m => m b -> m a -> m a Source #

ifM :: Monad m => m Bool -> (m a, m a) -> m a Source #

getM :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b) Source #

anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool Source #

allM :: Monad m => (a -> m Bool) -> [a] -> m Bool Source #

(<&&>) :: Monad m => m Bool -> m Bool -> m Bool infixr 3 Source #

untilTrue :: Monad m => [a] -> (a -> m Bool) -> m Bool Source #

(<||>) :: Monad m => m Bool -> m Bool -> m Bool infixr 2 Source #

observe :: Monad m => (a -> m b) -> m a -> m a Source #

noop :: Monad m => m () Source #

hGetContentsStrict :: Handle -> IO String Source #

readFileStrict :: FilePath -> IO String Source #

separate :: (a -> Bool) -> [a] -> ([a], [a]) Source #

firstLine :: String -> String Source #

segment :: (a -> Bool) -> [a] -> [[a]] Source #

prop_segment_regressionTest :: Bool Source #

segmentDelim :: (a -> Bool) -> [a] -> [[a]] Source #

massReplace :: [(String, String)] -> String -> String Source #

hGetSomeString :: Handle -> Int -> IO String Source #

exitBool :: Bool -> IO a Source #

type FileMode = CMode #

modifyFileMode :: FilePath -> (FileMode -> FileMode) -> IO () Source #

modifyFileMode' :: FilePath -> (FileMode -> FileMode) -> IO FileMode Source #

withModifiedFileMode :: FilePath -> (FileMode -> FileMode) -> IO a -> IO a Source #

addModes :: [FileMode] -> FileMode -> FileMode Source #

combineModes :: [FileMode] -> FileMode Source #

removeModes :: [FileMode] -> FileMode -> FileMode Source #

writeModes :: [FileMode] Source #

readModes :: [FileMode] Source #

executeModes :: [FileMode] Source #

otherGroupModes :: [FileMode] Source #

preventWrite :: FilePath -> IO () Source #

allowWrite :: FilePath -> IO () Source #

allowRead :: FilePath -> IO () Source #

groupSharedModes :: [FileMode] Source #

groupWriteRead :: FilePath -> IO () Source #

checkMode :: FileMode -> FileMode -> Bool Source #

isSymLink :: FileMode -> Bool Source #

isExecutable :: FileMode -> Bool Source #

noUmask :: (MonadIO m, MonadMask m) => FileMode -> m a -> m a Source #

withUmask :: (MonadIO m, MonadMask m) => FileMode -> m a -> m a Source #

getUmask :: IO FileMode Source #

defaultFileMode :: IO FileMode Source #

isSticky :: FileMode -> Bool Source #

stickyMode :: FileMode Source #

setSticky :: FilePath -> IO () Source #

writeFileProtected :: FilePath -> String -> IO () Source #

writeFileProtected' :: FilePath -> (Handle -> IO ()) -> IO () Source #

protectedOutput :: IO a -> IO a Source #