ADPfusion-0.5.1.0: Efficient, high-level dynamic programming.

Safe HaskellNone
LanguageHaskell2010

ADP.Fusion.Base.Multi

Contents

Synopsis

Multi-dimensional extension

data M Source

Terminates a multi-dimensional terminal symbol stack.

Constructors

M 

data TermSymbol a b Source

Terminal symbols are stacked together with a tails and b head.

Constructors

a :| b infixl 2 

Instances

(SplitIxCol uId (SameSid uId (Elm ls i)) (Elm ls i), Zconcat (SplitIxTy uId (SameSid uId (Elm ls i)) (Elm ls i)) (SplitIxTy uId (SameSid uId (TermSymbol a b)) (TermSymbol a b))) => SplitIxCol uId True (Elm ((:!:) ls (TermSymbol a b)) i) Source 
(Monad m, MkStream m ls i, Element ls i, TermStaticVar (TermSymbol a b) i, TermStream m (TermSymbol a b) (Elm ls i) i) => MkStream m ((:!:) ls (TermSymbol a b)) i Source 
(Eq a, Eq b) => Eq (TermSymbol a b) Source 
(Show i, Show (RunningIndex i), Show (TermArg (TermSymbol a b)), Show (Elm ls i)) => Show (Elm ((:!:) ls (TermSymbol a b)) i) Source 
(Show a, Show b) => Show (TermSymbol a b) Source 
Build (TermSymbol a b) Source 
Element ls i => Element ((:!:) ls (TermSymbol a b)) i Source 
(TermStaticVar a is, TermStaticVar b i) => TermStaticVar (TermSymbol a b) ((:.) is i) Source 
type SplitIxTy uId True (Elm ((:!:) ls (TermSymbol a b)) i) = Zpp (SplitIxTy uId (SameSid uId (Elm ls i)) (Elm ls i)) (SplitIxTy uId (SameSid uId (TermSymbol a b)) (TermSymbol a b)) Source 
type Stack (TermSymbol a b) = (:!:) S (TermSymbol a b) 
data Elm ((:!:) ls (TermSymbol a b)) = ElmTS !(TermArg (TermSymbol a b)) !(RunningIndex i) !(Elm ls i) Source 
type Arg ((:!:) ls (TermSymbol a b)) = (:.) (Arg ls) (TermArg (TermSymbol a b)) Source 
type TermArg (TermSymbol a b) = (:.) (TermArg a) (TermArg b) Source 

type family TermArg x :: * Source

Extracts the type of a multi-dimensional terminal argument.

Instances

type TermArg M = Z Source 
type TermArg Deletion = () Source 
type TermArg Epsilon = () Source 
type TermArg (Edge e) = e Source 
type TermArg (PeekIndex i) = PeekIndex i Source 
type TermArg (TermSymbol a b) = (:.) (TermArg a) (TermArg b) Source 
type TermArg (Chr r x) = r Source 
type TermArg (Strng v x) = v x Source 
type TermArg (Backtrack (ITbl mF arr c i x) mF mB r) = (x, [r]) Source 
type TermArg (IRec m c i x) = x Source 
type TermArg (ITbl m arr c i x) = x Source 

class TermStaticVar t i where Source

For multi-dimensional terminals we need to be able to calculate how the static/variable signal changes and if the index for the inner part needs to be modified.

Methods

termStaticVar :: t -> Context i -> i -> Context i Source

termStreamIndex :: t -> Context i -> i -> i Source

class TableStaticVar u c i where Source

Methods

tableStaticVar :: Proxy u -> c -> Context i -> i -> Context i Source

tableStreamIndex :: Proxy u -> c -> Context i -> i -> i Source

Instances

TableStaticVar c u Z Source 
(TableStaticVar us cs is, TableStaticVar u c i) => TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i) Source 

data TermState s i e Source

Constructors

TState 

Fields

tS :: !s

state coming in from the left , tIx :: !(RunningIndex a) -- I/C index from sS

iIx :: !(RunningIndex i)

I/C building up state to hand over to next symbol

eTS :: !e

element data

class TermStream m t s i where Source

Methods

termStream :: t -> Context i -> i -> i -> Stream m (TermState s Z Z) -> Stream m (TermState s i (TermArg t)) Source

Instances

addTermStream1 :: (Monad m, TermStream m (TermSymbol M t) (Elm (Term1 s) (Z :. i)) (Z :. i)) => t -> Context i -> i -> i -> Stream m s -> Stream m (s, TermArg t, RunningIndex i) Source

TODO need t -> ElmType t type function

TODO need to actually return an ElmType t can do that instead of returning u !!!

newtype Term1 s Source

Constructors

Term1 s 

Instances

((~) * s (Elm x0 i), Element x0 i) => Element (Term1 s) ((:.) Z i) Source 
data Elm (Term1 s) ((:.) Z i) = ElmTerm1 s Source 

elmTerm1 :: s -> i -> Elm (Term1 s) (Z :. i) Source

type TmkCtx1 m ls t i = (Monad m, MkStream m ls i, TermStream m (TermSymbol M t) (Elm (Term1 (Elm ls i)) (Z :. i)) (Z :. i), Element ls i, TermStaticVar t i) Source

Term MkStream context

type TstCtx m ts s x0 sixty is i = (Monad m, TermStream m ts s is, GetIndex (RunningIndex sixty) (RunningIndex (is :. i)), GetIx (RunningIndex sixty) (RunningIndex (is :. i)) ~ RunningIndex i, Element x0 sixty, s ~ Elm x0 sixty) Source

Term TermStream context

type PRI is i = Proxy (RunningIndex (is :. i)) Source

Shorthand for proxifying getIndex