Safe Haskell | Safe-Inferred |
---|---|
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
- read :: Read a => String -> a
- head :: [a] -> a
- tail :: [a] -> [a]
- init :: [a] -> [a]
- last :: [a] -> a
- readish :: Read a => String -> Maybe a
- headMaybe :: [a] -> Maybe a
- lastMaybe :: [a] -> Maybe a
- beginning :: [a] -> [a]
- end :: [a] -> [a]
- data CmdSpec
- = ShellCommand String
- | RawCommand FilePath [String]
- data ProcessHandle
- data StdStream
- = Inherit
- | UseHandle Handle
- | CreatePipe
- | NoStream
- type Pid = CPid
- proc :: FilePath -> [String] -> CreateProcess
- createPipe :: IO (Handle, Handle)
- 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
- 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
- data StdHandle
- readProcess :: FilePath -> [String] -> IO String
- 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
- createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- waitForProcess :: ProcessHandle -> IO ExitCode
- 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
- 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
- data SomeException = Exception e => SomeException e
- class MonadThrow m => MonadCatch (m :: Type -> Type) where
- class Monad m => MonadThrow (m :: Type -> Type) where
- 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)
- data ExitCase 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)
- mask_ :: (HasCallStack, MonadMask m) => m a -> m a
- uninterruptibleMask_ :: (HasCallStack, MonadMask m) => m a -> m a
- catches :: (HasCallStack, Foldable f, MonadCatch m) => m a -> f (Handler m a) -> m a
- 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
- 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
- catchPermissionDenied :: MonadCatch m => (IOException -> m a) -> m a -> m a
- getEnv :: String -> IO (Maybe String)
- getEnvDefault :: String -> String -> IO String
- getEnvironment :: IO [(String, String)]
- addEntry :: Eq k => k -> v -> [(k, v)] -> [(k, v)]
- addEntries :: Eq k => [(k, v)] -> [(k, v)] -> [(k, v)]
- delEntry :: Eq k => k -> [(k, v)] -> [(k, v)]
- setEnv :: String -> String -> Bool -> IO ()
- unsetEnv :: String -> IO ()
- dirCruft :: FilePath -> Bool
- 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 ()
- data Permissions
- data XdgDirectory
- data XdgDirectoryList
- getTemporaryDirectory :: IO FilePath
- removeFile :: FilePath -> IO ()
- 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
- isDirectoryEmpty :: FilePath -> IO Bool
- isUnpopulated :: FilePath -> IO Bool
- fsCruft :: FilePath -> Bool
- testDirectory :: FilePath -> (FilePath -> Bool) -> IO 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
- withTmpDirIn :: (MonadMask m, MonadIO m) => FilePath -> Template -> (FilePath -> m a) -> m a
- removeTmpDir :: MonadIO m => FilePath -> m ()
- firstM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe 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
- untilTrue :: Monad m => [a] -> (a -> m Bool) -> m Bool
- ifM :: Monad m => m Bool -> (m a, m a) -> m a
- (<||>) :: Monad m => m Bool -> m Bool -> m Bool
- (<&&>) :: Monad m => m Bool -> m Bool -> m Bool
- observe :: Monad m => (a -> m b) -> m a -> m a
- after :: Monad m => 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
- 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
- type FileMode = CMode
Documentation
Constructors
ShellCommand String | |
RawCommand FilePath [String] |
Instances
IsString CmdSpec | |
Defined in System.Process.Common Methods fromString :: String -> CmdSpec # | |
Show CmdSpec | |
Eq CmdSpec | |
data ProcessHandle #
Constructors
Inherit | |
UseHandle Handle | |
CreatePipe | |
NoStream |
proc :: FilePath -> [String] -> CreateProcess #
createPipe :: IO (Handle, Handle) #
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 #
data CreateProcess #
Constructors
CreateProcess | |
Fields
|
Instances
Show CreateProcess | |
Defined in System.Process.Common Methods showsPrec :: Int -> CreateProcess -> ShowS show :: CreateProcess -> String showList :: [CreateProcess] -> ShowS | |
Eq CreateProcess | |
Defined in System.Process.Common |
Constructors
StdinHandle | |
StdoutHandle | |
StderrHandle |
readProcess :: FilePath -> [String] -> IO String Source #
Normally, when reading from a process, it does not need to be fed any standard input.
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.
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.
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 #
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 #
Instances
Exception AsyncCancelled | |
Defined in Control.Concurrent.Async.Internal Methods toException :: AsyncCancelled -> SomeException # fromException :: SomeException -> Maybe AsyncCancelled # displayException :: AsyncCancelled -> String # | |
Exception ExceptionInLinkedThread | |
Defined in Control.Concurrent.Async.Internal Methods toException :: ExceptionInLinkedThread -> SomeException # fromException :: SomeException -> Maybe ExceptionInLinkedThread # displayException :: ExceptionInLinkedThread -> String # | |
Exception NestedAtomically | |
Defined in Control.Exception.Base Methods toException :: NestedAtomically -> SomeException # fromException :: SomeException -> Maybe NestedAtomically # displayException :: NestedAtomically -> String # | |
Exception NoMatchingContinuationPrompt | |
Defined in Control.Exception.Base Methods toException :: NoMatchingContinuationPrompt -> SomeException # fromException :: SomeException -> Maybe NoMatchingContinuationPrompt # displayException :: NoMatchingContinuationPrompt -> String # | |
Exception NoMethodError | |
Defined in Control.Exception.Base Methods toException :: NoMethodError -> SomeException # fromException :: SomeException -> Maybe NoMethodError # displayException :: NoMethodError -> String # | |
Exception NonTermination | |
Defined in Control.Exception.Base Methods toException :: NonTermination -> SomeException # fromException :: SomeException -> Maybe NonTermination # displayException :: NonTermination -> String # | |
Exception PatternMatchFail | |
Defined in Control.Exception.Base Methods toException :: PatternMatchFail -> SomeException # fromException :: SomeException -> Maybe PatternMatchFail # displayException :: PatternMatchFail -> String # | |
Exception RecConError | |
Defined in Control.Exception.Base Methods toException :: RecConError -> SomeException # fromException :: SomeException -> Maybe RecConError # displayException :: RecConError -> String # | |
Exception RecSelError | |
Defined in Control.Exception.Base Methods toException :: RecSelError -> SomeException # fromException :: SomeException -> Maybe RecSelError # displayException :: RecSelError -> String # | |
Exception RecUpdError | |
Defined in Control.Exception.Base Methods toException :: RecUpdError -> SomeException # fromException :: SomeException -> Maybe RecUpdError # displayException :: RecUpdError -> String # | |
Exception TypeError | |
Defined in Control.Exception.Base Methods toException :: TypeError -> SomeException # fromException :: SomeException -> Maybe TypeError # displayException :: TypeError -> String # | |
Exception Dynamic | |
Defined in Data.Dynamic Methods toException :: Dynamic -> SomeException # fromException :: SomeException -> Maybe Dynamic # displayException :: Dynamic -> String # | |
Exception Void | |
Defined in GHC.Exception.Type Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String # | |
Exception ErrorCall | |
Defined in GHC.Exception Methods toException :: ErrorCall -> SomeException # fromException :: SomeException -> Maybe ErrorCall # displayException :: ErrorCall -> String # | |
Exception ArithException | |
Defined in GHC.Exception.Type Methods toException :: ArithException -> SomeException # fromException :: SomeException -> Maybe ArithException # displayException :: ArithException -> String # | |
Exception SomeException | |
Defined in GHC.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # | |
Exception AllocationLimitExceeded | |
Defined in GHC.IO.Exception Methods toException :: AllocationLimitExceeded -> SomeException # fromException :: SomeException -> Maybe AllocationLimitExceeded # displayException :: AllocationLimitExceeded -> String # | |
Exception ArrayException | |
Defined in GHC.IO.Exception Methods toException :: ArrayException -> SomeException # fromException :: SomeException -> Maybe ArrayException # displayException :: ArrayException -> String # | |
Exception AssertionFailed | |
Defined in GHC.IO.Exception Methods toException :: AssertionFailed -> SomeException # fromException :: SomeException -> Maybe AssertionFailed # displayException :: AssertionFailed -> String # | |
Exception AsyncException | |
Defined in GHC.IO.Exception Methods toException :: AsyncException -> SomeException # fromException :: SomeException -> Maybe AsyncException # displayException :: AsyncException -> String # | |
Exception BlockedIndefinitelyOnMVar | |
Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnMVar -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnMVar # displayException :: BlockedIndefinitelyOnMVar -> String # | |
Exception BlockedIndefinitelyOnSTM | |
Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnSTM -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnSTM # displayException :: BlockedIndefinitelyOnSTM -> String # | |
Exception CompactionFailed | |
Defined in GHC.IO.Exception Methods toException :: CompactionFailed -> SomeException # fromException :: SomeException -> Maybe CompactionFailed # displayException :: CompactionFailed -> String # | |
Exception Deadlock | |
Defined in GHC.IO.Exception Methods toException :: Deadlock -> SomeException # fromException :: SomeException -> Maybe Deadlock # displayException :: Deadlock -> String # | |
Exception ExitCode | |
Defined in GHC.IO.Exception Methods toException :: ExitCode -> SomeException # fromException :: SomeException -> Maybe ExitCode # displayException :: ExitCode -> String # | |
Exception FixIOException | |
Defined in GHC.IO.Exception Methods toException :: FixIOException -> SomeException # fromException :: SomeException -> Maybe FixIOException # displayException :: FixIOException -> String # | |
Exception IOException | |
Defined in GHC.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String # | |
Exception SomeAsyncException | |
Defined in GHC.IO.Exception Methods toException :: SomeAsyncException -> SomeException # fromException :: SomeException -> Maybe SomeAsyncException # displayException :: SomeAsyncException -> String # | |
Exception StopPropellorException Source # | |
Defined in Propellor.Types.Exception Methods toException :: StopPropellorException -> SomeException # fromException :: SomeException -> Maybe StopPropellorException # displayException :: StopPropellorException -> String # |
data SomeException #
Constructors
Exception e => SomeException e |
Instances
Exception SomeException | |
Defined in GHC.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # | |
Show SomeException | |
Defined in GHC.Exception.Type Methods showsPrec :: Int -> SomeException -> ShowS show :: SomeException -> String showList :: [SomeException] -> ShowS |
class MonadThrow m => MonadCatch (m :: Type -> Type) where #
Instances
MonadCatch STM | |
Defined in Control.Monad.Catch | |
MonadCatch IO | |
Defined in Control.Monad.Catch | |
MonadCatch Propellor Source # | |
e ~ SomeException => MonadCatch (Either e) | |
Defined in Control.Monad.Catch | |
MonadCatch m => MonadCatch (MaybeT m) | |
Defined in Control.Monad.Catch | |
MonadCatch m => MonadCatch (ExceptT e m) | |
Defined in Control.Monad.Catch | |
MonadCatch m => MonadCatch (IdentityT m) | |
Defined in Control.Monad.Catch | |
MonadCatch m => MonadCatch (ReaderT r m) | |
Defined in Control.Monad.Catch | |
MonadCatch m => MonadCatch (StateT s m) | |
Defined in Control.Monad.Catch | |
MonadCatch m => MonadCatch (StateT s m) | |
Defined in Control.Monad.Catch | |
(MonadCatch m, Monoid w) => MonadCatch (WriterT w m) | |
Defined in Control.Monad.Catch | |
(MonadCatch m, Monoid w) => MonadCatch (WriterT w m) | |
Defined in Control.Monad.Catch | |
(MonadCatch m, Monoid w) => MonadCatch (RWST r w s m) | |
Defined in Control.Monad.Catch | |
(MonadCatch m, Monoid w) => MonadCatch (RWST r w s m) | |
Defined in Control.Monad.Catch |
class Monad m => MonadThrow (m :: Type -> Type) where #
Instances
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
MonadMask IO | |
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 # | |
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) # | |
e ~ SomeException => MonadMask (Either e) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) | |
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) # |
Constructors
ExitCaseSuccess a | |
ExitCaseException SomeException | |
ExitCaseAbort |
bracketOnError :: (HasCallStack, MonadMask m) => m a -> (a -> m c) -> (a -> m b) -> m b #
catchJust :: (HasCallStack, MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> 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) #
uninterruptibleMask_ :: (HasCallStack, MonadMask m) => m a -> m a #
catches :: (HasCallStack, Foldable f, MonadCatch m) => m a -> f (Handler m a) -> m a #
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 #
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 #
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
Instances
Show IOErrorType | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS show :: IOErrorType -> String showList :: [IOErrorType] -> ShowS | |
Eq IOErrorType | |
Defined in GHC.IO.Exception |
catchPermissionDenied :: MonadCatch m => (IOException -> m a) -> m a -> m a Source #
getEnvDefault :: String -> String -> IO String Source #
getEnvironment :: IO [(String, String)] Source #
addEntries :: Eq k => [(k, v)] -> [(k, v)] -> [(k, v)] Source #
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 #
data Permissions #
Instances
Read Permissions | |
Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS Permissions readList :: ReadS [Permissions] readPrec :: ReadPrec Permissions readListPrec :: ReadPrec [Permissions] | |
Show Permissions | |
Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> Permissions -> ShowS show :: Permissions -> String showList :: [Permissions] -> ShowS | |
Eq Permissions | |
Defined in System.Directory.Internal.Common | |
Ord Permissions | |
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 #
Instances
data XdgDirectoryList #
Constructors
XdgDataDirs | |
XdgConfigDirs |
Instances
getTemporaryDirectory :: IO FilePath #
removeFile :: FilePath -> IO () #
canonicalizePath :: FilePath -> IO FilePath #
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 #
setOwnerExecutable :: Bool -> Permissions -> Permissions #
setOwnerReadable :: Bool -> Permissions -> Permissions #
setOwnerSearchable :: Bool -> Permissions -> Permissions #
setOwnerWritable :: Bool -> Permissions -> Permissions #
isDirectoryEmpty :: FilePath -> IO Bool Source #
True only when directory exists and contains nothing. 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.
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.
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 #
withTmpDirIn :: (MonadMask m, MonadIO m) => FilePath -> Template -> (FilePath -> m a) -> m a Source #
removeTmpDir :: MonadIO m => FilePath -> m () Source #
hGetContentsStrict :: Handle -> IO String Source #
readFileStrict :: FilePath -> IO String Source #
prop_segment_regressionTest :: Bool Source #
segmentDelim :: (a -> Bool) -> [a] -> [[a]] Source #
massReplace :: [(String, String)] -> String -> String Source #
hGetSomeString :: Handle -> Int -> IO String Source #
modifyFileMode :: FilePath -> (FileMode -> FileMode) -> IO () Source #
withModifiedFileMode :: FilePath -> (FileMode -> FileMode) -> IO a -> IO a Source #
combineModes :: [FileMode] -> FileMode Source #
writeModes :: [FileMode] Source #
executeModes :: [FileMode] Source #
otherGroupModes :: [FileMode] Source #
preventWrite :: FilePath -> IO () Source #
allowWrite :: FilePath -> IO () Source #
groupSharedModes :: [FileMode] Source #
groupWriteRead :: FilePath -> IO () Source #
isExecutable :: FileMode -> Bool Source #
defaultFileMode :: IO FileMode Source #
writeFileProtected :: FilePath -> String -> IO () Source #
writeFileProtected' :: FilePath -> (Handle -> IO ()) -> IO () Source #
protectedOutput :: IO a -> IO a Source #