This library provides support for strict state threads, as described in the PLDI '94 paper by John Launchbury and Simon Peyton Jones Lazy Functional State Threads.
The lazy state-transformer monad. A computation of type ST s a transforms an internal state indexed by s, and returns a value of type a. The s parameter is either
* an unstantiated type variable (inside invocations of runST), or
* RealWorld (inside invocations of stToIO).
It serves to keep the internal states of different invocations of runST separate from each other and from invocations of stToIO.
The >>= and >> operations are not strict in the state. For example,
> runST (writeSTRef _|_ v >>= readSTRef _|_ >> return 2) = 2
The strict state-transformer monad. A computation of type ST s a transforms an internal state indexed by s, and returns a value of type a. The s parameter is either
* an uninstantiated type variable (inside invocations of runST), or
* RealWorld (inside invocations of Control.Monad.ST.stToIO).
It serves to keep the internal states of different invocations of runST separate from each other and from invocations of Control.Monad.ST.stToIO.
The >>= and >> operations are strict in the state (though not in values stored in the state). For example,
> runST (writeSTRef _|_ v >>= f) = _|_
Mutable references in the (strict) ST monad.
a value of type STRef s a is a mutable variable in state thread s, containing a value of type a
A monad supporting atomic memory transactions.
A String is a list of characters. String constants in Haskell are values of type String.
Mutable references in the (strict) ST monad (re-export of Data.STRef)
The String type and associated operations.
Utilities for primitive marshalling of C strings.
The marshalling converts each Haskell character, representing a Unicode code point, to one or more bytes in a manner that, by default, is determined by the current locale. As a consequence, no guarantees can be made about the relative length of a Haskell string and its corresponding C string, and therefore all the marshalling routines include memory allocation. The translation between Unicode and the encoding of the current locale may be lossy.
This module is part of the Foreign Function Interface (FFI) and will usually be imported via the module Foreign.
The module Foreign.Storable provides most elementary support for marshalling and is part of the language-independent portion of the Foreign Function Interface (FFI), and will normally be imported via the Foreign module.
An abstract name for an object, that supports equality and hashing.
Stable names have the following property:
* If sn1 :: StableName and sn2 :: StableName and sn1 == sn2 then sn1 and sn2 were created by calls to makeStableName on the same object.
The reverse is not necessarily true: if two stable names are not equal, then the objects they name may still be equal. Note in particular that mkStableName may return a different StableName after an object is evaluated.
Stable Names are similar to Stable Pointers (Foreign.StablePtr), but differ in the following ways:
* There is no freeStableName operation, unlike Foreign.StablePtrs. Stable names are reclaimed by the runtime system when they are no longer needed.
* There is no deRefStableName operation. You can't get back from a stable name to the original Haskell object. The reason for this is that the existence of a stable name for an object does not guarantee the existence of the object itself; it can still be garbage collected.
A stable pointer is a reference to a Haskell expression that is guaranteed not to be affected by garbage collection, i.e., it will neither be deallocated nor will the value of the stable pointer itself change during garbage collection (ordinary references may be relocated during garbage collection). Consequently, stable pointers can be passed to foreign code, which can treat it as an opaque reference to a Haskell value.
A value of type StablePtr a is a stable pointer to a Haskell expression of type a.
The current thread's stack exceeded its limit. Since an exception has been raised, the thread's stack will certainly be below its limit again, but the programmer should take remedial action immediately.
A handle managing output to the Haskell program's standard error channel.
A handle managing input from the Haskell program's standard input channel.
A handle managing output to the Haskell program's standard output channel.
Show more results