PrimitiveArray-0.8.0.1: Efficient multidimensional arrays

Safe HaskellNone
LanguageHaskell2010

Data.PrimitiveArray.FillTables

Contents

Description

Operations to fill primitive arrays. Arrays are combined just like indices using Z and '(:.)'. This allows filling an unlimited number of tables. ExtShape provides the rangeStream function with generates a stream of indices in (generally) the right order.

Synopsis

High-level table filling system.

unsafeRunFillTables :: (Index sh, IndexStream sh, WriteCell m (tail :. (MutArr m (arr sh elm), t)) sh, MPrimArrayOps arr sh elm, Monad m, PrimMonad m) => (tail :. (MutArr m (arr sh elm), t)) -> m () Source #

Run the forward phase of algorithms. Is *really* unsafe for now if tables have different sizes, as in its broken.

TODO Need to run min/max on the bounds for all tables, not just the last table. Otherwise we don't really need the distinction between save and unsafe. This will have to be in runFillTables.

Write to individuel cells.

class Monad m => WriteCell m c sh where Source #

WriteCell provides methods to fill all cells with a specific index sh in a stack of non-terminal tables c.

Minimal complete definition

unsafeWriteCell, writeCell

Methods

unsafeWriteCell :: c -> sh -> m () Source #

writeCell :: c -> sh -> m () Source #

Instances

Monad m => WriteCell m Z sh Source # 

Methods

unsafeWriteCell :: Z -> sh -> m () Source #

writeCell :: Z -> sh -> m () Source #

(WriteCell m cs sh, Monad m, MPrimArrayOps arr sh a, PrimMonad m) => WriteCell m ((:.) cs (MutArr m (arr sh a), sh -> m a)) sh Source # 

Methods

unsafeWriteCell :: (cs :. (MutArr m (arr sh a), sh -> m a)) -> sh -> m () Source #

writeCell :: (cs :. (MutArr m (arr sh a), sh -> m a)) -> sh -> m () Source #