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.StdStream

Contents

Description

This module provides the associated optics and combinators for working with StdStream objects. StdStream consists of four cases, for which we provide traversals for each case

Synopsis

Traversals

_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

Classy Traversals

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 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 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 #

Combinators

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

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

Examples:

>>> inheriting ($) CreatePipe
Inherit

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

Given a lens into a StdStream, overwrite to CreatePipe.

Examples:

>>> piping ($) NoStream
CreatePipe

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.stdout Inherit
UseHandle {handle: <stdout>}

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

Given a lens into a StdStream, set to NoStream

Examples:

>>> nostreaming ($) Inherit
NoStream