Copyright | (c) 2019-2021 Emily Pillmore |
---|---|
License | BSD |
Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
Stability | Experimental |
Portability | TypeFamilies, Rank2Types |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- _Inherit :: Prism' StdStream ()
- _UseHandle :: Prism' StdStream Handle
- _CreatePipe :: Prism' StdStream ()
- _NoStream :: Prism' StdStream ()
- class AsInherit a where
- class AsUseHandle a where
- _UsesHandle :: Prism' a Handle
- class AsCreatePipe a where
- _CreatesPipe :: Prism' a ()
- class AsNoStream a where
- _NoStreams :: Prism' a ()
- usehandleOf :: AsUseHandle 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
_CreatePipe :: Prism' StdStream () Source #
Classy Prisms
class AsUseHandle a where Source #
_UsesHandle :: Prism' a Handle Source #
Instances
AsUseHandle StdStream Source # | |
Defined in System.Process.Lens.StdStream |
class AsCreatePipe 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 () Source #
Instances
AsCreatePipe StdStream Source # | |
Defined in System.Process.Lens.StdStream _CreatesPipe :: Prism' StdStream () Source # |
class AsNoStream 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 () Source #
Instances
AsNoStream StdStream Source # | |
Defined in System.Process.Lens.StdStream _NoStreams :: Prism' StdStream () Source # |
Combinators
usehandleOf :: AsUseHandle 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 id System.stdin $ UseHandle System.stdout
UseHandle {handle: <stdin>}
>>>
handling id System.stdin NoStream
NoStream
>>>
handling id System.stdin Inherit
Inherit