base-4.18.1.0: Basic libraries

Copyright | (c) The University of Glasgow 2008
License | see libraries/base/LICENSE
Maintainer | cvs-ghc@haskell.org
Stability | internal
Portability | non-portable (GHC Extensions)
Safe Haskell | Unsafe
Language | Haskell2010

GHC.IOArray

Description

The IOArray type

Synopsis

- newtype IOArray i e = IOArray (STArray RealWorld i e)
- newIOArray :: Ix i => (i, i) -> e -> IO (IOArray i e)
- unsafeReadIOArray :: IOArray i e -> Int -> IO e
- unsafeWriteIOArray :: IOArray i e -> Int -> e -> IO ()
- readIOArray :: Ix i => IOArray i e -> i -> IO e
- writeIOArray :: Ix i => IOArray i e -> i -> e -> IO ()
- boundsIOArray :: IOArray i e -> (i, i)

# Documentation

newtype IOArray i e Source #

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.

Constructors

IOArray (STArray RealWorld i e) |

#### Instances

Instances details

Eq (IOArray i e) Source # | Since: base-4.1.0.0
Instance details Defined in GHC.IOArray Methods (==) :: IOArray i e -> IOArray i e -> Bool Source # (/=) :: IOArray i e -> IOArray i e -> Bool Source #

newIOArray :: Ix i => (i, i) -> e -> IO (IOArray i e) Source #

Build a new `IOArray`

unsafeReadIOArray :: IOArray i e -> Int -> IO e Source #

Read a value from an `IOArray`

unsafeWriteIOArray :: IOArray i e -> Int -> e -> IO () Source #

Write a new value into an `IOArray`

readIOArray :: Ix i => IOArray i e -> i -> IO e Source #

Read a value from an `IOArray`

writeIOArray :: Ix i => IOArray i e -> i -> e -> IO () Source #

Write a new value into an `IOArray`

boundsIOArray :: IOArray i e -> (i, i) Source #