base-4.20.2.0: Core data structures and operations

Copyright | (c) The University of Glasgow 2008
License | see libraries/base/LICENSE
Maintainer | ghc-devs@haskell.org
Stability | internal
Portability | non-portable (GHC Extensions)
Safe Haskell | None
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) | Since: base-4.1.0.0
Instance details Defined in GHC.Internal.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 #