|
GHC.IO.Buffer | Portability | non-portable (GHC Extensions) | Stability | internal | Maintainer | cvs-ghc@haskell.org |
|
|
|
|
|
Description |
Buffers used in the IO system
|
|
Synopsis |
|
|
|
|
Buffers of any element
|
|
|
A mutable array of bytes that can be passed to foreign functions.
The buffer is represented by a record, where the record contains
the raw buffer and the start/end points of the filled portion. The
buffer contents itself is mutable, but the rest of the record is
immutable. This is a slightly odd mix, but it turns out to be
quite practical: by making all the buffer metadata immutable, we
can have operations on buffer metadata outside of the IO monad.
The live elements of the buffer are those between the bufL and
bufR offsets. In an empty buffer, bufL is equal to bufR, but
they might not be zero: for exmaple, the buffer might correspond to
a memory-mapped file and in which case bufL will point to the
next location to be written, which is not necessarily the beginning
of the file.
| Constructors | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
Creation
|
|
|
|
|
|
|
|
|
|
Insertion/removal
|
|
|
|
|
|
|
slides the contents of the buffer to the beginning
|
|
|
|
Inspecting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Operating on the raw buffer as a Ptr
|
|
|
|
|
|
Assertions
|
|
|
|
Raw buffers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.6.1 |