Copyright | 2019 Emily Pillmore |
---|---|
License | BSD |
Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
Stability | Experimental |
Portability | TypeFamilies, Rank2Types |
Safe Haskell | Safe |
Language | Haskell2010 |
Synopsis
- _Inherit :: Prism' StdStream StdStream
- _UseHandle :: Prism' StdStream Handle
- _CreatePipe :: Prism' StdStream StdStream
- _NoStream :: Prism' StdStream StdStream
- class IsInherit a where
- class IsUseHandle a where
- class IsCreatePipe a where
- class IsNoStream a where
- usehandleOf :: IsUseHandle a => Handle -> a
- inheriting :: Lens' a StdStream -> a -> a
- piping :: Lens' a StdStream -> a -> a
- handling :: Lens' a StdStream -> Handle -> a -> a
- nostreaming :: Lens' a StdStream -> a -> a
Prisms
_UseHandle :: Prism' StdStream Handle Source #
_CreatePipe :: Prism' StdStream StdStream Source #
Classy Prisms
class IsUseHandle a where Source #
_UsesHandle :: Prism' a Handle Source #
Instances
IsUseHandle StdStream Source # | |
Defined in System.Process.Lens.StdStream _UsesHandle :: Prism' 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 :: Prism' a StdStream Source #
Instances
IsCreatePipe StdStream Source # | |
Defined in System.Process.Lens.StdStream _CreatesPipe :: Prism' 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 :: Prism' a StdStream Source #
Instances
IsNoStream StdStream Source # | |
Defined in System.Process.Lens.StdStream _NoStreams :: Prism' StdStream StdStream Source # |
Combinators
usehandleOf :: IsUseHandle a => Handle -> a Source #
Inject a handle into something with a prism into the handle
Examples:
>>>
usehandleOf @StdStream System.stdin
UseHandle {handle: <stdin>}
inheriting :: Lens' a StdStream -> a -> a Source #
handling :: Lens' a StdStream -> Handle -> a -> a Source #
Given a lens into a StdStream
and a handle, set the handle using
UseHandle
. Note that this is the only really interesting case for anything
with a lens into a handle inculding StdStream
.
Examples:
>>>
handling ($) System.stdin $ UseHandle System.stdout
UseHandle {handle: <stdin>}
>>>
handling ($) System.stdin NoStream
NoStream
>>>
handling ($) System.stdin Inherit
Inherit