shell-conduit-4.7.0: Write shell scripts with Conduit
Safe HaskellNone
LanguageHaskell98

Data.Conduit.Shell.Process

Description

Reading from the process.

Synopsis

Running scripts

run :: Segment r -> IO r Source #

Run a segment.

Conduit types

text :: (r ~ (), m ~ IO) => ConduitT Text Text m r -> Segment r Source #

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

bytes :: (a ~ ByteString, m ~ IO) => ConduitT a ByteString m r -> Segment r Source #

Lift a conduit into a segment.

General conduits

conduit :: (a ~ ByteString, m ~ IO) => ConduitT a ByteString m r -> Segment r Source #

Lift a conduit into a segment.

conduitEither :: (a ~ ByteString, m ~ IO) => ConduitT a (Either ByteString ByteString) m r -> Segment r Source #

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

Running processes

shell :: String -> Segment () Source #

Run a shell command.

proc :: String -> [String] -> Segment () Source #

Run a process command.

($|) :: Segment () -> Segment b -> Segment b infixl 0 Source #

Fuse two segments (either processes or conduits).

data Segment r Source #

A pipeable segment. Either a conduit or a process.

Instances

Instances details
Monad Segment Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

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

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

return :: a -> Segment a

Functor Segment Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

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

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

Applicative Segment Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

pure :: a -> Segment a

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

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

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

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

Alternative Segment Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

empty :: Segment a

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

some :: Segment a -> Segment [a]

many :: Segment a -> Segment [a]

MonadIO Segment Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

liftIO :: IO a -> Segment a #

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

Defined in Data.Conduit.Shell.Variadic

Methods

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

data ProcessException Source #

Process running exception.

Instances

Instances details
Show ProcessException Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

showsPrec :: Int -> ProcessException -> ShowS

show :: ProcessException -> String

showList :: [ProcessException] -> ShowS

Exception ProcessException Source # 
Instance details

Defined in Data.Conduit.Shell.Process

class ToChunk a where Source #

Used to allow outputting stdout or stderr.

Methods

toChunk :: a -> Either ByteString ByteString Source #

Instances

Instances details
ToChunk ByteString Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

toChunk :: ByteString -> Either ByteString ByteString Source #

ToChunk (Either ByteString ByteString) Source # 
Instance details

Defined in Data.Conduit.Shell.Process

Methods

toChunk :: Either ByteString ByteString -> Either ByteString ByteString Source #

tryS :: Exception e => Segment r -> Segment (Either e r) Source #

Try something in a segment.