propellor-5.18: property-based host configuration management in haskell
Safe HaskellNone
LanguageHaskell2010

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

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 #

waitForProcess :: ProcessHandle -> IO ExitCode Source #

Wrapper around waitForProcess that does debug logging.

data CreateProcess #

Constructors

CreateProcess 

Fields

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

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 #

Instances

Instances details
Eq StdHandle Source # 
Instance details

Defined in Utility.Process

Methods

(==) :: StdHandle -> StdHandle -> Bool

(/=) :: StdHandle -> StdHandle -> Bool

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.

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. -}

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.

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 #

data StdStream #

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

createPipeFd :: IO (FD, FD) #

callCommand :: String -> IO () #

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

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

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

shell :: String -> CreateProcess #

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

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

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

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

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 #

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

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

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

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 #

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 #

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

data XdgDirectory #

Instances

Instances details
Bounded XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Enum XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

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

data XdgDirectoryList #

Constructors

XdgDataDirs 
XdgConfigDirs 

Instances

Instances details
Bounded XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Enum XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Read XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

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

Ord XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

exeExtension :: String #

findExecutables :: String -> IO [FilePath] #

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

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

getAccessTime :: FilePath -> IO UTCTime #

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

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

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

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

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.

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 #

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 #

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 #

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

firstLine :: String -> String Source #

segment :: (a -> Bool) -> [a] -> [[a]] 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 #

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

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