monadic-arrays-0.2: Boxed and unboxed arrays for monad transformers

Portabilitytype families, MPTCs
MaintainerEdward Kmett <>






class Monad m => MonadArray m whereSource

Arr m serves as a canonical choice of boxed MArray

Associated Types

data Arr m :: * -> * -> *Source


getBoundsM :: Ix i => Arr m i e -> m (i, i)Source

getNumElementsM :: Ix i => Arr m i e -> m IntSource

newArrayM :: Ix i => (i, i) -> e -> m (Arr m i e)Source

newArrayM_ :: Ix i => (i, i) -> m (Arr m i e)Source

unsafeNewArrayM_ :: Ix i => (i, i) -> m (Arr m i e)Source

unsafeReadM :: Ix i => Arr m i e -> Int -> m eSource

unsafeWriteM :: Ix i => Arr m i e -> Int -> e -> m ()Source


class (MonadArray m, MArray (UArr m) Bool m, MArray (UArr m) Char m, MArray (UArr m) Int m, MArray (UArr m) Word m, MArray (UArr m) Double m, MArray (UArr m) Float m, MArray (UArr m) Int8 m, MArray (UArr m) Int16 m, MArray (UArr m) Int32 m, MArray (UArr m) Int64 m, MArray (UArr m) Word8 m, MArray (UArr m) Word16 m, MArray (UArr m) Word32 m, MArray (UArr m) Word64 m, MArray1 (UArr m) StablePtr m, MArray1 (UArr m) FunPtr m, MArray1 (UArr m) Ptr m) => MonadUArray m Source

UArr m provides unboxed arrays, and can be used on the primitive data types:

Bool, Char, Int, Word, Double, Float, Int8, Int16, Int32, Int64, Word8, Word16, Word32, and Word64

It can be used via MArray1 to store values of types StablePtr a, FunPtr a and 'Ptr a' as well.

Associated Types

data UArr m :: * -> * -> *Source