PrimitiveArray- Efficient multidimensional arrays

Safe HaskellNone




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.


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


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

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


Monad m => WriteCell m Z sh Source # 


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 # 


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 #