microlens-process-0.2.0.0: Micro-optics for the process library

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

System.Process.Microlens.Optics

Contents

Description

Just the (classy) optics

Synopsis

Traversals

_ShellCommand :: Traversal' CmdSpec String Source #

A Traversal' into the ShellCommand case of a CmdSpec

Examples:

>>> ShellCommand "ls -l" ^? _ShellCommand
Just "ls -l"
>>> RawCommand "/bin/ls" ["-l"] ^? _ShellCommand
Nothing

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

A Traversal' into the RawCommand case of a CmdSpec

Examples:

>>> RawCommand "/bin/ls" ["-l"] ^? _RawCommand
Just ("/bin/ls",["-l"])
>>> RawCommand "/bin/ls" ["-l"] ^? _ShellCommand
Nothing
>>> RawCommand "/bin/ls" ["-l"] ^. _RawCommand . _1
"/bin/ls"
>>> RawCommand "/bin/ls" ["-l"] ^. _RawCommand . _2
["-l"]

_Inherit :: Traversal' StdStream StdStream Source #

A Traversal' into the Inherit structure of a StdStream

_UseHandle :: Traversal' StdStream Handle Source #

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

_CreatePipe :: Traversal' StdStream StdStream Source #

A Traversal' into the CreatePipe structure of a StdStream

_NoStream :: Traversal' StdStream StdStream Source #

A Traversal' into the NoStream structure of a StdStream

arguments :: Traversal' CmdSpec [String] Source #

Traversal' into the arguments of a command

Examples:

>>> RawCommand "/bin/ls" ["-l"] ^. arguments
["-l"]

Lenses

_Handler :: Lens' ProcessHandler (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) Source #

An isomorphism between a ProcessHandler and its tuple representation

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

creategroup :: Lens' CreateProcess Bool Source #

Lens into the create_group entry of the CreateProcess record

delegatectlc :: Lens' CreateProcess Bool Source #

Lens into the delegate_ctlc entry of the CreateProcess record

newsession :: Lens' CreateProcess Bool Source #

Lens into the new_session entry of the CreateProcess record

detachconsole :: Lens' CreateProcess Bool Source #

Lens into the detach_console entry of the CreateProcess record

createnewconsole :: Lens' CreateProcess Bool Source #

Lens into the create_new_console 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

useprocessjobs :: Lens' CreateProcess Bool Source #

Lens into the use_process_jobs entry of the CreateProcess record

hstdin :: Lens' ProcessHandler (Maybe Handle) Source #

A lens into the stdin handle if requested

hstdout :: Lens' ProcessHandler (Maybe Handle) Source #

A lens into the stdout handle if requested

hstderr :: Lens' ProcessHandler (Maybe Handle) Source #

A lens into the stderr handle if requested

hhandle :: Lens' ProcessHandler ProcessHandle Source #

A lens into the process handle

Classy Prisms

class IsRaw a where Source #

Classy Traversal' into the raw command of a CmdSpec

Minimal complete definition

_Raw

Methods

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

Instances
IsRaw CmdSpec Source # 
Instance details

Defined in System.Process.Microlens.CmdSpec

Methods

_Raw :: Traversal' CmdSpec (FilePath, [String]) Source #

class IsShell a where Source #

Classy Traversal' into the shell command of a CmdSpec

Minimal complete definition

_Shell

Methods

_Shell :: Traversal' a String Source #

Instances
IsShell CmdSpec Source # 
Instance details

Defined in System.Process.Microlens.CmdSpec

Methods

_Shell :: Traversal' CmdSpec String Source #

class IsInherit a where Source #

Class constraint proving a type has a prism into an Inherit structure. Any StdStream will have a prism into Inherit - it is just an overwrite to Inherit

Minimal complete definition

_Inherits

Methods

_Inherits :: Traversal' a StdStream Source #

Instances
IsInherit StdStream Source # 
Instance details

Defined in System.Process.Microlens.StdStream

Methods

_Inherits :: Traversal' StdStream StdStream Source #

class IsUseHandle a where Source #

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

Minimal complete definition

_UsesHandle

Methods

_UsesHandle :: Traversal' a Handle Source #

Instances
IsUseHandle StdStream Source # 
Instance details

Defined in System.Process.Microlens.StdStream

Methods

_UsesHandle :: Traversal' StdStream Handle Source #

class IsCreatePipe a where Source #

Class constraint proving a type has a prism into a Handle via a UseHandle structure. Any StdStream will have a prism into CreatePipe - it is just an overwrite to CreatePipe

Minimal complete definition

_CreatesPipe

Methods

_CreatesPipe :: Traversal' a StdStream Source #

Instances
IsCreatePipe StdStream Source # 
Instance details

Defined in System.Process.Microlens.StdStream

Methods

_CreatesPipe :: Traversal' StdStream StdStream Source #

class IsNoStream a where Source #

Class constraint proving a type has a prism into a Handle via a UseHandle structure. Any StdStream will have a prism into NoStream - it is just an overwrite to NoStream.

Minimal complete definition

_NoStreams

Methods

_NoStreams :: Traversal' a StdStream Source #

Instances
IsNoStream StdStream Source # 
Instance details

Defined in System.Process.Microlens.StdStream

Methods

_NoStreams :: Traversal' StdStream StdStream Source #

Classy Lenses

class HasStdin a where Source #

Classy lens for types with a stdin

Minimal complete definition

_Stdin

Methods

_Stdin :: Lens' a StdStream Source #

class HasStdout a where Source #

Classy lens for types with a stdout

Minimal complete definition

_Stdout

Methods

_Stdout :: Lens' a StdStream Source #

class HasStderr a where Source #

Classy lens for types with a stderr

Minimal complete definition

_Stderr

Methods

_Stderr :: Lens' a StdStream Source #