hat-2.9.0.0: The Haskell tracer, generating and viewing Haskell execution traces

Safe HaskellNone
LanguageHaskell98

Hat.IO

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.

hhPrint :: Show a => R Handle -> R a -> RefExp -> R (IO Tuple0) Source

htry :: R (IO a) -> RefExp -> R (IO (Either IOError a)) Source

gbracket :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun a (IO b)) (Fun (Fun a (IO c)) (IO c)))) Source

hbracket :: R (IO a) -> R (Fun a (IO b)) -> R (Fun a (IO c)) -> RefExp -> R (IO c) Source

gbracket_ :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun a (IO b)) (Fun (IO c) (IO c)))) Source

hbracket_ :: R (IO a) -> R (Fun a (IO b)) -> R (IO c) -> RefExp -> R (IO c) Source

data IO a Source

Instances

type IOError = IOException

The Haskell 2010 type for exceptions in the IO monad. Any I/O operation may raise an IOError instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Control.Exception.Exception.

In Haskell 2010, this is an opaque type.

gcatch :: RefSrcPos -> RefExp -> R (Fun (IO a) (Fun (Fun IOError (IO a)) (IO a))) Source

hcatch :: R (IO b) -> R (Fun IOError (IO b)) -> RefExp -> R (IO b) Source

hprint :: Show a => R a -> RefExp -> R (IO Tuple0) Source

hreadIO :: Read a => R String -> RefExp -> R (IO a) Source

greadLn :: Read a => RefSrcPos -> RefExp -> R (IO a) Source