ArrayRef-0.1.3: Unboxed references, dynamic arrays and moreSource codeContentsIndex
GHC.ArrBZ
PortabilityGHC
Stabilityexperimental
MaintainerBulat Ziganshin <Bulat.Ziganshin@gmail.com>
Description
Vectors of boxed values
Synopsis
data Vec a = Vec (Array# a)
data MVec s a = MVec (MutableArray# s a)
allocBoxed :: (STorIO m s, Integral elems) => elems -> a -> m (MVec s a)
unsafeFreezeBoxed :: STorIO m s => MVec s a -> m (Vec a)
unsafeThawBoxed :: STorIO m s => Vec a -> m (MVec s a)
freezeBoxed :: STorIO m s => MVec s a -> Int -> a -> m (Vec a)
thawBoxed :: STorIO m s => Vec a -> Int -> a -> m (MVec s a)
fromI# :: Integral n => n -> Int#
readBoxed :: (STorIO m s, Integral index) => MVec s value -> index -> m value
writeBoxed :: (STorIO m s, Integral index) => MVec s value -> index -> value -> m ()
indexBoxed :: Integral index => Vec value -> index -> value
Documentation
data Vec a Source
Immutable and mutable vectors of boxed values
Constructors
Vec (Array# a)
data MVec s a Source
Constructors
MVec (MutableArray# s a)
allocBoxed :: (STorIO m s, Integral elems) => elems -> a -> m (MVec s a)Source
Alloc the mutable vector
unsafeFreezeBoxed :: STorIO m s => MVec s a -> m (Vec a)Source
Mutable->immutable vector on-place conversion
unsafeThawBoxed :: STorIO m s => Vec a -> m (MVec s a)Source
Immutable->mutable vector on-place conversion
freezeBoxed :: STorIO m s => MVec s a -> Int -> a -> m (Vec a)Source
Mutable->immutable vector conversion which takes a copy of contents
thawBoxed :: STorIO m s => Vec a -> Int -> a -> m (MVec s a)Source
Immutable->mutable vector conversion which takes a copy of contents
fromI# :: Integral n => n -> Int#Source
readBoxed :: (STorIO m s, Integral index) => MVec s value -> index -> m valueSource
Read the value from mutable vector at given index
writeBoxed :: (STorIO m s, Integral index) => MVec s value -> index -> value -> m ()Source
Write the value to mutable vector at given index
indexBoxed :: Integral index => Vec value -> index -> valueSource
Read the value from immutable vector at given index
Produced by Haddock version 2.4.2