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.

TODO make explicit in which order the tables are filled.


Driver classes for table filling system.

class UpperTriS m stack whereSource


upperTriS :: stack -> m ()Source


(Monad m, MPrimArrayOps arr (:. Z Subword) e, Stack m Subword (:. xs (SubwordNonTerminal m arr e))) => UpperTriS m (:. xs (SubwordNonTerminal m arr e)) 

class Stack m sh xs whereSource

Defines how a single index in a stack of arrays + evaluation functions is handled. The instances *should* work for any index ix.


writeStack :: xs -> sh -> m ()Source


Monad m => Stack m sh Z 
(PrimMonad m, Stack m ix xs, MPrimArrayOps arr ix e) => Stack m ix (:. xs (GeneralNonTerminal m arr ix e)) 
(PrimMonad m, Stack m Subword xs, MPrimArrayOps arr (:. Z Subword) e) => Stack m Subword (:. xs (SubwordNonTerminal m arr e)) 


1-tape grammars with Subword indices.

Multi-tape indices.

type SubwordNonTerminal m arr e = (MutArr m (arr (Z :. Subword) e), Subword -> m e)Source

type GeneralNonTerminal m arr ix e = (MutArr m (arr ix e), ix -> m e)Source