shell-conduit-5.0.0: Write shell scripts with Conduit
Safe HaskellNone
LanguageHaskell2010

Data.Conduit.Shell.Process

Description

Reading from the process.

Synopsis

Running scripts

run :: MonadIO m => Segment m r -> m r Source #

Run a segment.

Conduit types

text :: forall r (m :: Type -> Type). (r ~ (), MonadThrow m) => ConduitT Text Text m r -> Segment m r Source #

Work on the stream as Text values from UTF-8.

bytes :: forall a (m :: Type -> Type) r. (a ~ ByteString, Monad m) => ConduitT a ByteString m r -> Segment m r Source #

Lift a conduit into a segment.

General conduits

conduit :: forall a (m :: Type -> Type) r. (a ~ ByteString, Monad m) => ConduitT a ByteString m r -> Segment m r Source #

Lift a conduit into a segment.

conduitEither :: forall a (m :: Type -> Type) r. (a ~ ByteString, Monad m) => ConduitT a (Either ByteString ByteString) m r -> Segment m r Source #

Lift a conduit into a segment, which can yield stderr.

Running processes

shell :: forall (m :: Type -> Type). MonadIO m => String -> Segment m () Source #

Run a shell command.

proc :: forall (m :: Type -> Type). MonadIO m => String -> [String] -> Segment m () Source #

Run a process command.

($|) :: forall (m :: Type -> Type) b. MonadUnliftIO m => Segment m () -> Segment m b -> Segment m b infixl 0 Source #

Fuse two segments (either processes or conduits).

data Segment (m :: Type -> Type) r Source #

A pipeable segment. Either a conduit or a process.

Instances

Instances details
MonadIO m => MonadIO (Segment m) Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

liftIO :: IO a -> Segment m a #

MonadUnliftIO m => Alternative (Segment m) Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

empty :: Segment m a #

(<|>) :: Segment m a -> Segment m a -> Segment m a #

some :: Segment m a -> Segment m [a] #

many :: Segment m a -> Segment m [a] #

MonadIO m => Applicative (Segment m) Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

pure :: a -> Segment m a #

(<*>) :: Segment m (a -> b) -> Segment m a -> Segment m b #

liftA2 :: (a -> b -> c) -> Segment m a -> Segment m b -> Segment m c #

(*>) :: Segment m a -> Segment m b -> Segment m b #

(<*) :: Segment m a -> Segment m b -> Segment m a #

MonadIO m => Functor (Segment m) Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

fmap :: (a -> b) -> Segment m a -> Segment m b #

(<$) :: a -> Segment m b -> Segment m a #

MonadIO m => Monad (Segment m) Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

(>>=) :: Segment m a -> (a -> Segment m b) -> Segment m b #

(>>) :: Segment m a -> Segment m b -> Segment m b #

return :: a -> Segment m a #

(r ~ (), MonadIO m) => ProcessType (Segment m r) Source # 
Instance details

Defined in Data.Conduit.Shell.Variadic

Methods

spr :: String -> [Text] -> Segment m r Source #

class ToChunk a where Source #

Used to allow outputting stdout or stderr.

tryS :: forall e (m :: Type -> Type) r. (Exception e, MonadUnliftIO m) => Segment m r -> Segment m (Either e r) Source #

Try something in a segment.