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

Safe HaskellNone
LanguageHaskell98

ADP.Fusion

Contents

Description

Pure combinators along the lines of original ADP. We simply re-export the monadic interface without the monadic function application combinator.

Synopsis

Documentation

StreamGen

class Monad m => StreamGen m t r | t -> r where Source

Generate stream from either one (DIM2 -> m cnt) or some combination of terminals derived from uses of nextTo.

Methods

streamGen :: t -> DIM2 -> Stream m r Source

PreStreamGen

class Monad m => PreStreamGen m s q | s -> q where Source

Required by most StreamGen instances just before extractStreamLast is called.

Methods

preStreamGen Source

Arguments

:: s

the composite type of the arguments

-> DIM2

the original index (Z:.i:.j)

-> Stream m q

the stream we get out of it

singlePreStreamGen :: (Ord head, Num head, Monad m) => (:.) ((:.) Z head) head -> Stream m ((:.) ((:.) Z head) head, Z, Z) Source

Creates the single step on the left which does nothing more then set the outermost indices to (i,j). This does not use the alpha/omega's

ExtractValue: extract values from data structures.

class Monad m => ExtractValue m cnt where Source

Associated Types

type Asor cnt :: * Source

type Elem cnt :: * Source

Methods

extractValue :: cnt -> DIM2 -> Asor cnt -> m (Elem cnt) Source

extractStream :: cnt -> Stream m (Idx3 z, astack, vstack) -> Stream m (Idx3 z, astack :. Asor cnt, vstack :. Elem cnt) Source

extractStreamLast :: cnt -> Stream m (Idx2 z, astack, vstack) -> Stream m (Idx2 z, astack :. Asor cnt, vstack :. Elem cnt) Source

Apply function f with arguments on a stack x.

class Apply x where Source

Associated Types

type Fun x :: * Source

Methods

apply :: Fun x -> x Source

helper stuff

data Box mk step xs ys Source

Constructors

Box mk step xs ys 

type Idx3 z = ((z :. Int) :. Int) :. Int Source

type Idx2 z = (z :. Int) :. Int Source

wrappers for functions instead of arrays as arguments. It can be much

newtype Scalar a Source

Constructors

Scalar 

Fields

unScalar :: a
 

newtype ScalarM a Source

Constructors

ScalarM 

Fields

unScalarM :: a
 

newtype Vect a Source

Constructors

Vect 

Fields

unVect :: a
 

newtype VectM a Source

Constructors

VectM 

Fields

unVectM :: a