exitcode-0.3.0.1: Monad transformer for exit codes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Process.Handle

Synopsis

Documentation

data Handle #

Haskell defines operations to read and write characters from and to files, represented by values of type Handle. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:

  • whether it manages input or output or both;
  • whether it is open, closed or semi-closed;
  • whether the object is seekable;
  • whether buffering is disabled, or enabled on a line or block basis;
  • a buffer (whose length may be zero).

Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the Show and Eq classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to == only to itself; no attempt is made to compare the internal state of different handles for equality.

Instances

Instances details
Show Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

AsHandle Handle Source #
>>> preview _Handle stdin
Just {handle: <stdin>}
Instance details

Defined in Control.Process.Handle

GetHandle Handle Source #
>>> view getHandle stdin
{handle: <stdin>}
Instance details

Defined in Control.Process.Handle

HasHandle Handle Source #
>>> view handle stdin
{handle: <stdin>}
Instance details

Defined in Control.Process.Handle

ReviewHandle Handle Source #
>>> review reviewHandle stdin :: Handle
{handle: <stdin>}
Instance details

Defined in Control.Process.Handle

Eq Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

(==) :: Handle -> Handle -> Bool #

(/=) :: Handle -> Handle -> Bool #

class GetHandle a where Source #

Type class for values that can be viewed as a Handle.

>>> view getHandle stdin
{handle: <stdin>}

Instances

Instances details
GetHandle Handle Source #
>>> view getHandle stdin
{handle: <stdin>}
Instance details

Defined in Control.Process.Handle

class GetHandle a => HasHandle a where Source #

Type class for values with a lens into a Handle.

>>> view handle stdin
{handle: <stdin>}

Methods

handle :: Lens' a Handle Source #

Instances

Instances details
HasHandle Handle Source #
>>> view handle stdin
{handle: <stdin>}
Instance details

Defined in Control.Process.Handle

class ReviewHandle a where Source #

Type class for values that can be constructed from a Handle.

>>> review reviewHandle stdin :: Handle
{handle: <stdin>}

Instances

Instances details
ReviewHandle Handle Source #
>>> review reviewHandle stdin :: Handle
{handle: <stdin>}
Instance details

Defined in Control.Process.Handle

ReviewHandle StdStream Source #
>>> review reviewHandle stdout :: StdStream
UseHandle {handle: <stdout>}
Instance details

Defined in Control.Process.Handle

class ReviewHandle a => AsHandle a where Source #

Type class for values with a prism into a Handle.

>>> preview _Handle stdin
Just {handle: <stdin>}

Instances

Instances details
AsHandle Handle Source #
>>> preview _Handle stdin
Just {handle: <stdin>}
Instance details

Defined in Control.Process.Handle

AsHandle StdStream Source #
>>> preview _Handle (UseHandle stdout)
Just {handle: <stdout>}
>>> preview _Handle (Inherit :: StdStream)
Nothing
>>> review _Handle stdout :: StdStream
UseHandle {handle: <stdout>}
Instance details

Defined in Control.Process.Handle