shrun-0.9: A utility program for running shell commands concurrently.
Safe HaskellNone
LanguageGHC2021

Shrun.ShellT

Description

Provides the ShellT monad transformer.

Synopsis

Documentation

data ShellT env (m :: Type -> Type) a Source #

ShellT is the main application type that runs shell commands.

Instances

Instances details
Monad m => MonadReader env (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

ask :: ShellT env m env #

local :: (env -> env) -> ShellT env m a -> ShellT env m a #

reader :: (env -> a) -> ShellT env m a #

MonadIO m => MonadIO (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

liftIO :: IO a -> ShellT env m a #

Applicative m => Applicative (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

pure :: a -> ShellT env m a #

(<*>) :: ShellT env m (a -> b) -> ShellT env m a -> ShellT env m b #

liftA2 :: (a -> b -> c) -> ShellT env m a -> ShellT env m b -> ShellT env m c #

(*>) :: ShellT env m a -> ShellT env m b -> ShellT env m b #

(<*) :: ShellT env m a -> ShellT env m b -> ShellT env m a #

Functor m => Functor (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

fmap :: (a -> b) -> ShellT env m a -> ShellT env m b #

(<$) :: a -> ShellT env m b -> ShellT env m a #

Monad m => Monad (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

(>>=) :: ShellT env m a -> (a -> ShellT env m b) -> ShellT env m b #

(>>) :: ShellT env m a -> ShellT env m b -> ShellT env m b #

return :: a -> ShellT env m a #

MonadAsync m => MonadAsync (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

withAsync :: HasCallStack => ShellT env m a -> (Async a -> ShellT env m b) -> ShellT env m b Source #

withAsyncBound :: HasCallStack => ShellT env m a -> (Async a -> ShellT env m b) -> ShellT env m b Source #

withAsyncOn :: HasCallStack => Int -> ShellT env m a -> (Async a -> ShellT env m b) -> ShellT env m b Source #

withAsyncWithUnmask :: HasCallStack => ((forall c. ShellT env m c -> ShellT env m c) -> ShellT env m a) -> (Async a -> ShellT env m b) -> ShellT env m b Source #

withAsyncOnWithUnmask :: HasCallStack => Int -> ((forall c. ShellT env m c -> ShellT env m c) -> ShellT env m a) -> (Async a -> ShellT env m b) -> ShellT env m b Source #

wait :: HasCallStack => Async a -> ShellT env m a Source #

poll :: HasCallStack => Async a -> ShellT env m (Maybe (Either SomeException a)) Source #

waitCatch :: HasCallStack => Async a -> ShellT env m (Either SomeException a) Source #

cancel :: HasCallStack => Async a -> ShellT env m () Source #

uninterruptibleCancel :: HasCallStack => Async a -> ShellT env m () Source #

cancelWith :: (Exception e, HasCallStack) => Async a -> e -> ShellT env m () Source #

race :: HasCallStack => ShellT env m a -> ShellT env m b -> ShellT env m (Either a b) Source #

concurrently :: HasCallStack => ShellT env m a -> ShellT env m b -> ShellT env m (a, b) Source #

concurrently_ :: HasCallStack => ShellT env m a -> ShellT env m b -> ShellT env m () Source #

waitAny :: HasCallStack => [Async a] -> ShellT env m (Async a, a) Source #

waitAnyCatch :: HasCallStack => [Async a] -> ShellT env m (Async a, Either SomeException a) Source #

waitAnyCancel :: HasCallStack => [Async a] -> ShellT env m (Async a, a) Source #

waitAnyCatchCancel :: HasCallStack => [Async a] -> ShellT env m (Async a, Either SomeException a) Source #

waitEither :: HasCallStack => Async a -> Async b -> ShellT env m (Either a b) Source #

waitEitherCatch :: HasCallStack => Async a -> Async b -> ShellT env m (Either (Either SomeException a) (Either SomeException b)) Source #

waitEitherCancel :: HasCallStack => Async a -> Async b -> ShellT env m (Either a b) Source #

waitEitherCatchCancel :: HasCallStack => Async a -> Async b -> ShellT env m (Either (Either SomeException a) (Either SomeException b)) Source #

waitEither_ :: HasCallStack => Async a -> Async b -> ShellT env m () Source #

waitBoth :: HasCallStack => Async a -> Async b -> ShellT env m (a, b) Source #

async :: HasCallStack => ShellT env m a -> ShellT env m (Async a) Source #

asyncBound :: HasCallStack => ShellT env m a -> ShellT env m (Async a) Source #

asyncOn :: HasCallStack => Int -> ShellT env m a -> ShellT env m (Async a) Source #

asyncWithUnmask :: HasCallStack => ((forall b. ShellT env m b -> ShellT env m b) -> ShellT env m a) -> ShellT env m (Async a) Source #

asyncOnWithUnmask :: HasCallStack => Int -> ((forall b. ShellT env m b -> ShellT env m b) -> ShellT env m a) -> ShellT env m (Async a) Source #

link :: HasCallStack => Async a -> ShellT env m () Source #

linkOnly :: HasCallStack => (SomeException -> Bool) -> Async a -> ShellT env m () Source #

link2 :: HasCallStack => Async a -> Async b -> ShellT env m () Source #

link2Only :: HasCallStack => (SomeException -> Bool) -> Async a -> Async b -> ShellT env m () Source #

pooledMapConcurrentlyN :: (HasCallStack, Traversable t) => Positive Int -> (a -> ShellT env m b) -> t a -> ShellT env m (t b) Source #

pooledMapConcurrently :: (HasCallStack, Traversable t) => (a -> ShellT env m b) -> t a -> ShellT env m (t b) Source #

pooledMapConcurrentlyN_ :: (Foldable f, HasCallStack) => Positive Int -> (a -> ShellT env m b) -> f a -> ShellT env m () Source #

pooledMapConcurrently_ :: (Foldable f, HasCallStack) => (a -> ShellT env m b) -> f a -> ShellT env m () Source #

MonadFileReader m => MonadFileReader (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadFileWriter m => MonadFileWriter (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadHandleReader m => MonadHandleReader (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadHandleWriter m => MonadHandleWriter (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadPathWriter m => MonadPathWriter (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadIORef m => MonadIORef (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

newIORef :: HasCallStack => a -> ShellT env m (IORef a) Source #

readIORef :: HasCallStack => IORef a -> ShellT env m a Source #

writeIORef :: HasCallStack => IORef a -> a -> ShellT env m () Source #

atomicWriteIORef :: HasCallStack => IORef a -> a -> ShellT env m () Source #

modifyIORef' :: HasCallStack => IORef a -> (a -> a) -> ShellT env m () Source #

atomicModifyIORef' :: HasCallStack => IORef a -> (a -> (a, b)) -> ShellT env m b Source #

MonadSTM m => MonadSTM (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

atomically :: HasCallStack => STM a -> ShellT env m a Source #

MonadThread m => MonadThread (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadTime m => MonadTime (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

MonadTypedProcess m => MonadTypedProcess (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

runProcess :: HasCallStack => ProcessConfig stdin stdout stderr -> ShellT env m ExitCode Source #

readProcess :: HasCallStack => ProcessConfig stdin stdoutIgnored stderrIgnored -> ShellT env m (ExitCode, ByteString, ByteString) Source #

readProcessStdout :: HasCallStack => ProcessConfig stdin stdoutIgnored stderr -> ShellT env m (ExitCode, ByteString) Source #

readProcessStderr :: HasCallStack => ProcessConfig stdin stdout stderrIgnored -> ShellT env m (ExitCode, ByteString) Source #

readProcessInterleaved :: HasCallStack => ProcessConfig stdin stdoutIgnored stderrIgnored -> ShellT env m (ExitCode, ByteString) Source #

withProcessWait :: HasCallStack => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> ShellT env m a) -> ShellT env m a Source #

withProcessTerm :: HasCallStack => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> ShellT env m a) -> ShellT env m a Source #

startProcess :: HasCallStack => ProcessConfig stdin stdout stderr -> ShellT env m (Process stdin stdout stderr) Source #

stopProcess :: HasCallStack => Process stdin stdout stderr -> ShellT env m () Source #

runProcess_ :: HasCallStack => ProcessConfig stdin stdout stderr -> ShellT env m () Source #

readProcess_ :: HasCallStack => ProcessConfig stdin stdoutIgnored stderrIgnored -> ShellT env m (ByteString, ByteString) Source #

readProcessStdout_ :: HasCallStack => ProcessConfig stdin stdoutIgnored stderr -> ShellT env m ByteString Source #

readProcessStderr_ :: HasCallStack => ProcessConfig stdin stdout stderrIgnored -> ShellT env m ByteString Source #

readProcessInterleaved_ :: HasCallStack => ProcessConfig stdin stdoutIgnored stderrIgnored -> ShellT env m ByteString Source #

withProcessWait_ :: HasCallStack => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> ShellT env m a) -> ShellT env m a Source #

withProcessTerm_ :: HasCallStack => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> ShellT env m a) -> ShellT env m a Source #

waitExitCode :: HasCallStack => Process stdin stdout stderr -> ShellT env m ExitCode Source #

getExitCode :: HasCallStack => Process stdin stdout stderr -> ShellT env m (Maybe ExitCode) Source #

checkExitCode :: HasCallStack => Process stdin stdout stderr -> ShellT env m () Source #

MonadCatch m => MonadCatch (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

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

MonadMask m => MonadMask (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

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

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

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

MonadThrow m => MonadThrow (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

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

MonadRegionLogger m => MonadRegionLogger (ShellT (Env r) m) Source # 
Instance details

Defined in Shrun.ShellT

Associated Types

type Region (ShellT (Env r) m) 
Instance details

Defined in Shrun.ShellT

type Region (ShellT (Env r) m) = Region (ReaderT (Env r) m)

Methods

logGlobal :: Text -> ShellT (Env r) m () Source #

logRegion :: LogMode -> Region (ShellT (Env r) m) -> Text -> ShellT (Env r) m () Source #

withRegion :: HasCallStack => RegionLayout -> (Region (ShellT (Env r) m) -> ShellT (Env r) m a) -> ShellT (Env r) m a Source #

displayRegions :: HasCallStack => ShellT (Env r) m a -> ShellT (Env r) m a Source #

MonadAppleScript m => MonadAppleScript (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

notify :: Text -> ShellT env m (Maybe ByteString) Source #

MonadDBus m => MonadDBus (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

(MonadAppleScript m, MonadDBus m, MonadNotifySend m) => MonadNotify (ShellT (Env r) m) Source # 
Instance details

Defined in Shrun.ShellT

MonadNotifySend m => MonadNotifySend (ShellT env m) Source # 
Instance details

Defined in Shrun.ShellT

Methods

notify :: Text -> ShellT env m (Maybe ByteString) Source #

type Region (ShellT (Env r) m) Source # 
Instance details

Defined in Shrun.ShellT

type Region (ShellT (Env r) m) = Region (ReaderT (Env r) m)

runShellT :: forall m env a. ShellT env m a -> env -> m a Source #

Runs a ShellT with the given env.