Copyright | 2019 Emily Pillmore |
---|---|
License | BSD |
Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
Stability | Experimental |
Portability | TypeFamilies, Rank2Types |
Safe Haskell | Safe |
Language | Haskell2010 |
Just the (classy) optics
Synopsis
- _ShellCommand :: Traversal' CmdSpec String
- _RawCommand :: Traversal' CmdSpec (FilePath, [String])
- _Inherit :: Traversal' StdStream StdStream
- _UseHandle :: Traversal' StdStream Handle
- _CreatePipe :: Traversal' StdStream StdStream
- _NoStream :: Traversal' StdStream StdStream
- arguments :: Traversal' CmdSpec [String]
- _Handler :: Lens' ProcessHandler (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- cmdspec_ :: Lens' CreateProcess CmdSpec
- cwd_ :: Lens' CreateProcess (Maybe FilePath)
- env_ :: Lens' CreateProcess (Maybe [(String, String)])
- stdin_ :: Lens' CreateProcess StdStream
- stdout_ :: Lens' CreateProcess StdStream
- stderr_ :: Lens' CreateProcess StdStream
- closefds :: Lens' CreateProcess Bool
- creategroup :: Lens' CreateProcess Bool
- delegatectlc :: Lens' CreateProcess Bool
- newsession :: Lens' CreateProcess Bool
- detachconsole :: Lens' CreateProcess Bool
- createnewconsole :: Lens' CreateProcess Bool
- childgroup :: Lens' CreateProcess (Maybe CGid)
- childuser :: Lens' CreateProcess (Maybe CUid)
- useprocessjobs :: Lens' CreateProcess Bool
- hstdin :: Lens' ProcessHandler (Maybe Handle)
- hstdout :: Lens' ProcessHandler (Maybe Handle)
- hstderr :: Lens' ProcessHandler (Maybe Handle)
- hhandle :: Lens' ProcessHandler ProcessHandle
- class IsRaw a where
- class IsShell a where
- class IsInherit a where
- class IsUseHandle a where
- class IsCreatePipe a where
- class IsNoStream a where
- class HasStdin a where
- class HasStdout a where
- class HasStderr a where
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"]
_UseHandle :: Traversal' StdStream Handle Source #
_CreatePipe :: Traversal' StdStream StdStream Source #
A Traversal'
into the CreatePipe
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
hhandle :: Lens' ProcessHandler ProcessHandle Source #
A lens into the process handle
Classy Prisms
Classy Traversal'
into the raw command of a CmdSpec
class IsUseHandle a where Source #
_UsesHandle :: Traversal' a Handle Source #
Instances
IsUseHandle StdStream Source # | |
Defined in System.Process.Microlens.StdStream _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
_CreatesPipe :: Traversal' a StdStream Source #
Instances
IsCreatePipe StdStream Source # | |
Defined in System.Process.Microlens.StdStream _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
.
_NoStreams :: Traversal' a StdStream Source #
Instances
IsNoStream StdStream Source # | |
Defined in System.Process.Microlens.StdStream _NoStreams :: Traversal' StdStream StdStream Source # |
Classy Lenses
class HasStdin a where Source #
Classy lens for types with a stdin
Instances
HasStdin CreateProcess Source # | |
Defined in System.Process.Microlens.CreateProcess _Stdin :: Lens' CreateProcess StdStream Source # | |
HasStdin StdStream Source # | |
class HasStdout a where Source #
Classy lens for types with a stdout
Instances
HasStdout CreateProcess Source # | |
Defined in System.Process.Microlens.CreateProcess _Stdout :: Lens' CreateProcess StdStream Source # | |
HasStdout StdStream Source # | |