array-0.1.0.0: Mutable and immutable arraysSource codeContentsIndex
Data.Array.IO
Portabilitynon-portable (uses Data.Array.MArray)
Stabilityexperimental
Maintainerlibraries@haskell.org
Contents
IO arrays with boxed elements
IO arrays with unboxed elements
Overloaded mutable array interface
Doing I/O with IOUArrays
Description
Mutable boxed and unboxed arrays in the IO monad.
Synopsis
IOArray
data IOUArray i e
castIOUArray :: IOUArray ix a -> IO (IOUArray ix b)
module Data.Array.MArray
hGetArray :: Handle -> IOUArray Int Word8 -> Int -> IO Int
hPutArray :: Handle -> IOUArray Int Word8 -> Int -> IO ()
IO arrays with boxed elements
IOArray
IO arrays with unboxed elements
data IOUArray i eSource

Mutable, unboxed, strict arrays in the IO monad. The type arguments are as follows:

  • i: the index type of the array (should be an instance of Ix)
  • e: the element type of the array. Only certain element types are supported: see Data.Array.MArray for a list of instances.
show/hide Instances
castIOUArray :: IOUArray ix a -> IO (IOUArray ix b)Source
Casts an IOUArray with one element type into one with a different element type. All the elements of the resulting array are undefined (unless you know what you're doing...).
Overloaded mutable array interface
module Data.Array.MArray
Doing I/O with IOUArrays
hGetArraySource
:: HandleHandle to read from
-> IOUArray Int Word8Array in which to place the values
-> IntNumber of Word8s to read
-> IO IntReturns: the number of Word8s actually read, which might be smaller than the number requested if the end of file was reached.
Reads a number of Word8s from the specified Handle directly into an array.
hPutArraySource
:: HandleHandle to write to
-> IOUArray Int Word8Array to write from
-> IntNumber of Word8s to write
-> IO ()
Writes an array of Word8 to the specified Handle.
Produced by Haddock version 0.9