lens-process-0.0.5.0: Optics for system processes

Copyright2019 Emily Pillmore
LicenseBSD
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
PortabilityTypeFamilies, RankNTypes
Safe HaskellSafe
LanguageHaskell2010

System.Process.Lens

Contents

Description

Everything all together

Synopsis

Optics

_RawCommand :: Prism' CmdSpec (FilePath, [String]) Source #

A prism into the RawCommand case of a CmdSpec

arguments :: Traversal' CmdSpec [String] Source #

Traversal' into the arguments of a command

_Inherit :: Prism' StdStream StdStream Source #

A prism into the Inherit structure of a StdStream

_UseHandle :: Prism' StdStream Handle Source #

A prism into the UseHandle structure's Handle for a StdStream

_CreatePipe :: Prism' StdStream StdStream Source #

A prism into the CreatePipe structure of a StdStream

_NoStream :: Prism' StdStream StdStream Source #

A prism into the NoStream structure of a StdStream

cmdspec_ :: Lens' CreateProcess CmdSpec Source #

Lens into the cmdspec entry of the CreateProcess record

cwd_ :: Lens' CreateProcess (Maybe FilePath) Source #

Lens into the cwd entry of the CreateProcess record

env_ :: Lens' CreateProcess (Maybe [(String, String)]) Source #

Lens into the env entry of the CreateProcess record

stdin :: Lens' CreateProcess StdStream Source #

Lens into the std_in entry of the CreateProcess record

stdout :: Lens' CreateProcess StdStream Source #

Lens into the std_out entry of the CreateProcess record

stderr :: Lens' CreateProcess StdStream Source #

Lens into the std_err entry of the CreateProcess record

closefds :: Lens' CreateProcess Bool Source #

Lens into the close_fds entry of the CreateProcess record

newsession :: Lens' CreateProcess Bool Source #

Lens into the new_session entry of the CreateProcess record

childgroup :: Lens' CreateProcess (Maybe CGid) Source #

Lens into the child_group entry of the CreateProcess record

childuser :: Lens' CreateProcess (Maybe CUid) Source #

Lens into the child_user entry of the CreateProcess record

Classes

class IsRaw a where Source #

Classy prism into the shell command of a CmdSpec

Methods

_Raw :: Prism' a (FilePath, [String]) Source #

Instances
IsRaw CmdSpec Source # 
Instance details

Defined in System.Process.Lens.CommandSpec

class IsShell a where Source #

Classy prism into the shell command of a CmdSpec

Instances
IsShell CmdSpec Source # 
Instance details

Defined in System.Process.Lens.CommandSpec

class IsInherit a where Source #

Class constraint proving a type has a prism into an Inherit structure. In general, this seems redundant, however, this class is a proof on a that a is an Inherit, which is a wonderful thing to prove.

class IsUseHandle a where Source #

Class constraint proving a type has a prism into a Handle via a UseHandle structure.

class IsCreatePipe a where Source #

Class constraint proving a type has a prism into a Handle via a UseHandle structure.

class IsNoStream a where Source #

Class constraint proving a type has a prism into a Handle via a UseHandle structure.

class HasStdin a where Source #

Classy lens for types with a stdin

class HasStdout a where Source #

Classy lens for types with a stdout

class HasStderr a where Source #

Classy lens for types with a stderr

Combinators

closing :: IsUseHandle a => Getter CreateProcess a -> CreateProcess -> IO () Source #

Close something with a prism into a non-standard Handle in a CreateProcess

inheriting :: IsInherit a => Lens' a StdStream -> a -> a Source #

Given a lens into a StdStream, overwrite to Inherit so that the stream inherits from its parent process

piping :: IsCreatePipe a => Lens' a StdStream -> a -> a Source #

Given a lens into a StdStream, overwrite to CreatePipe, piping the process

handling :: IsUseHandle a => Lens' a StdStream -> Handle -> a -> a Source #

Given a lens into a StdStream and a handle, set the handle using UseHandle.

nostreaming :: IsNoStream a => Lens' a StdStream -> a -> a Source #

Given a lens into a StdStream, set to NoStream

arguing :: String -> CmdSpec -> CmdSpec Source #

Append an argument to the argument list of a RawCommand

rawOf :: IsRaw a => FilePath -> [String] -> a Source #

Lift a FilePath and list of arguments into a type via RawCommand with a prism into the command

shellOf :: IsShell a => String -> a Source #

Lift a String into a type via ShellCommand with a prism into the command

usehandleOf :: IsUseHandle a => Handle -> a Source #

Inject a handle into something with a prism into the handle