ArrayRef-0.1.2: Unboxed references, dynamic arrays and moreSource codeContentsIndex
Data.Unboxed
PortabilityHugs/GHC
Stabilityexperimental
MaintainerBulat Ziganshin <Bulat.Ziganshin@gmail.com>
Description

Class Unboxed represents values that can be stored in unboxed vectors and unboxed references

Based on the: Hugs.ByteArray module

Synopsis
data UVec a
data MUVec s a
allocUnboxed :: forall s a elems m. (STorIO m s, Integral elems, Unboxed a) => elems -> m (MUVec s a)
unsafeFreezeUnboxed :: STorIO m s => MUVec s a -> m (UVec a)
unsafeThawUnboxed :: STorIO m s => UVec a -> m (MUVec s a)
freezeUnboxed :: STorIO m s => MUVec s a -> Int -> m (UVec a)
thawUnboxed :: STorIO m s => UVec a -> Int -> m (MUVec s a)
castUnboxed :: UVec a -> UVec b
castMUnboxed :: MUVec s a -> MUVec s b
class Unboxed value where
readUnboxed :: (STorIO m s, Integral index) => MUVec s value -> index -> m value
writeUnboxed :: (STorIO m s, Integral index) => MUVec s value -> index -> value -> m ()
indexUnboxed :: Integral index => UVec value -> index -> value
sizeOfUnboxed :: value -> Int
readUnboxed :: (Unboxed value, STorIO m s, Integral index) => MUVec s value -> index -> m value
writeUnboxed :: (Unboxed value, STorIO m s, Integral index) => MUVec s value -> index -> value -> m ()
indexUnboxed :: (Unboxed value, Integral index) => UVec value -> index -> value
sizeOfUnboxed :: Unboxed value => value -> Int
Documentation
data UVec a Source
Immutable and mutable byte vectors
data MUVec s a Source
allocUnboxed :: forall s a elems m. (STorIO m s, Integral elems, Unboxed a) => elems -> m (MUVec s a)Source

Additional operations on byte vectors

Alloc the mutable byte vector having elems elements of required type

unsafeFreezeUnboxed :: STorIO m s => MUVec s a -> m (UVec a)Source
Mutable->immutable byte vector on-place conversion
unsafeThawUnboxed :: STorIO m s => UVec a -> m (MUVec s a)Source
Immutable->mutable byte vector on-place conversion
freezeUnboxed :: STorIO m s => MUVec s a -> Int -> m (UVec a)Source
Mutable->immutable byte vector conversion which takes a copy of contents
thawUnboxed :: STorIO m s => UVec a -> Int -> m (MUVec s a)Source
Immutable->mutable byte vector conversion which takes a copy of contents
castUnboxed :: UVec a -> UVec bSource
Recast immutable unboxed vector
castMUnboxed :: MUVec s a -> MUVec s bSource
Recast mutable unboxed vector
class Unboxed value whereSource
Unboxed is like Storable, but values are stored in byte vectors (i.e. inside the Haskell heap)
Methods
readUnboxed :: (STorIO m s, Integral index) => MUVec s value -> index -> m valueSource
writeUnboxed :: (STorIO m s, Integral index) => MUVec s value -> index -> value -> m ()Source
indexUnboxed :: Integral index => UVec value -> index -> valueSource
sizeOfUnboxed :: value -> IntSource
show/hide Instances
readUnboxed :: (Unboxed value, STorIO m s, Integral index) => MUVec s value -> index -> m valueSource
Read the value from mutable byte vector at given index
writeUnboxed :: (Unboxed value, STorIO m s, Integral index) => MUVec s value -> index -> value -> m ()Source
Write the value to mutable byte vector at given index
indexUnboxed :: (Unboxed value, Integral index) => UVec value -> index -> valueSource
Read the value from immutable byte vector at given index
sizeOfUnboxed :: Unboxed value => value -> IntSource
How many bytes required to represent values of this type
Produced by Haddock version 2.1.0