ArrayRef-0.1.3.1: Unboxed references, dynamic arrays and moreSource codeContentsIndex
Data.ArrayBZ.ST
PortabilityHugs/GHC
Stabilityexperimental
MaintainerBulat Ziganshin <Bulat.Ziganshin@gmail.com>
Contents
Boxed arrays
Unboxed arrays
Overloaded mutable array interface
Description
Mutable boxed and unboxed arrays in the ST monad.
Synopsis
type STArray = BoxedMutableArray
runSTArray :: Ix i => (forall s. ST s (STArray s i e)) -> Array i e
type STUArray = UnboxedMutableArray
runSTUArray :: (Unboxed e, HasDefaultValue e, Ix i) => (forall s. ST s (STUArray s i e)) -> UArray i e
castSTUArray :: forall i e e' s. (Ix i, Enum i, Unboxed e, Unboxed e') => STUArray s i e -> STUArray s i e'
module Data.ArrayBZ.MArray
Boxed arrays
type STArray = BoxedMutableArraySource
Boxed mutable arrays in ST monad
runSTArray :: Ix i => (forall s. ST s (STArray s i e)) -> Array i eSource
A safe way to create and work with a mutable array before returning an immutable array for later perusal. This function avoids copying the array before returning it - it uses unsafeFreeze internally, but this wrapper is a safe interface to that function.
Unboxed arrays
type STUArray = UnboxedMutableArraySource
Unboxed mutable arrays in ST monad
runSTUArray :: (Unboxed e, HasDefaultValue e, Ix i) => (forall s. ST s (STUArray s i e)) -> UArray i eSource
A safe way to create and work with an unboxed mutable array before returning an immutable array for later perusal. This function avoids copying the array before returning it - it uses unsafeFreeze internally, but this wrapper is a safe interface to that function.
castSTUArray :: forall i e e' s. (Ix i, Enum i, Unboxed e, Unboxed e') => STUArray s i e -> STUArray s i e'Source
Casts an STUArray with one element type into STUArray with a different element type (upper bound is recalculated).
Overloaded mutable array interface
module Data.ArrayBZ.MArray
Produced by Haddock version 2.4.2