HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulearray-0.5.8.0Haskell2010

Data.Array.IO

Mutable boxed and unboxed arrays in the IO monad.

Contents
  1. IO arrays with boxed elements
  2. IO arrays with unboxed elements
  3. Overloaded mutable array interface
  4. Doing I/O with IOUArrays
Synopsis
  • Packagearray-0.5.8.0
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceIO.hs

IO arrays with boxed elements

newtypenewtype IOArray i e

An IOArray is a mutable, boxed, non-strict array 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.

Instances2MArray, Eq
  • MArray IOArray e IODefined in array-0.5.8.0 · Data.Array.Base
  • Eq (IOArray i e)Defined in ghc-internal-10.0.0 · GHC.Internal.IOArray

IO arrays with unboxed elements

newtypenewtype IOUArray i e

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.

Instances18MArray, Eq, …

Overloaded mutable array interface

Doing I/O with IOUArrays

valuehGetArray
  1. :: Handle

    Handle to read from

  2. -> IOUArray Int Word8

    Array in which to place the values

  3. -> Int

    Number of Word8s to read

  4. -> IO Int

    Returns: 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.