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

Safe HaskellNone
LanguageHaskell2010

ADP.Fusion.Term.Chr.Type

Description

TODO Rename Chr to Vtx, a vertex parser is a generalization of a char parser. But this is only semantics, so not super important to do now.

Synopsis

Documentation

data Chr r x where Source #

A generic Character parser that reads a single character but allows passing additional information.

Chr expects a function to retrieve r at index position, followed by the actual generic vector with data.

Constructors

Chr :: Vector v x => (v x -> Int -> r) -> !(v x) -> Chr r x 

Instances

(Show i, Show (RunningIndex i), Show r, Show (Elm ls i)) => Show (Elm ((:!:) ls (Chr r x)) i) Source # 

Methods

showsPrec :: Int -> Elm (ls :!: Chr r x) i -> ShowS #

show :: Elm (ls :!: Chr r x) i -> String #

showList :: [Elm (ls :!: Chr r x) i] -> ShowS #

Build (Chr r x) Source # 

Associated Types

type Stack (Chr r x) :: * Source #

Methods

build :: Chr r x -> Stack (Chr r x) Source #

Element ls i => Element ((:!:) ls (Chr r x)) i Source # 

Associated Types

data Elm ((:!:) ls (Chr r x)) i :: * Source #

type RecElm ((:!:) ls (Chr r x)) i :: * Source #

type Arg ((:!:) ls (Chr r x)) :: * Source #

Methods

getArg :: Elm (ls :!: Chr r x) i -> Arg (ls :!: Chr r x) Source #

getIdx :: Elm (ls :!: Chr r x) i -> RunningIndex i Source #

getElm :: Elm (ls :!: Chr r x) i -> RecElm (ls :!: Chr r x) i Source #

type Stack (Chr r x) Source # 
type Stack (Chr r x) = (:!:) S (Chr r x)
data Elm ((:!:) ls (Chr r x)) Source # 
data Elm ((:!:) ls (Chr r x)) = ElmChr !r !(RunningIndex i) !(Elm ls i)
type Arg ((:!:) ls (Chr r x)) Source # 
type Arg ((:!:) ls (Chr r x)) = (:.) (Arg ls) r
type TermArg (Chr r x) Source # 
type TermArg (Chr r x) = r

chr :: Vector v x => v x -> Chr x x Source #

smart constructor for regular 1-character parsers

chrLeft :: Vector v t => v t -> Chr (Maybe t, t) t Source #

Smart constructor for Maybe Peeking, followed by a character.