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

Safe HaskellNone
LanguageHaskell2010

ADP.Fusion.Core.Term.MultiChr

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 MultiChr (c :: Nat) (v :: * -> *) (x :: *) where Source #

A multi-character parser.

Constructors

MultiChr :: Vector v x => !(v x) -> MultiChr c v x 
Instances
(TermStream m (Z :. pos) (TermSymbol M (MultiChr c v x)) (Elm (Term1 (Elm ls (PointL i))) (Z :. PointL i)) (Z :. PointL i), posLeft ~ LeftPosTy pos (MultiChr c v x) (PointL i), TermStaticVar pos (MultiChr c v x) (PointL i), MkStream m posLeft ls (PointL i)) => MkStream m (pos :: Type) (ls :!: MultiChr c v x) (PointL i) Source #

First try in getting this right with a termStream.

TODO use PointL i since this is probably the same for all single-tape instances with ElmChr.

TODO it might even be possible to auto-generate this code via TH.

Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

Methods

mkStream :: Proxy pos -> (ls :!: MultiChr c v x) -> Int# -> LimitType (PointL i) -> PointL i -> Stream m (Elm (ls :!: MultiChr c v x) (PointL i)) Source #

(TermStream m (Z :. pos) (TermSymbol M (MultiChr c v x)) (Elm (Term1 (Elm ls (PointR i))) (Z :. PointR i)) (Z :. PointR i), posLeft ~ LeftPosTy pos (MultiChr c v x) (PointR i), TermStaticVar pos (MultiChr c v x) (PointR i), MkStream m posLeft ls (PointR i)) => MkStream m (pos :: Type) (ls :!: MultiChr c v x) (PointR i) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

Methods

mkStream :: Proxy pos -> (ls :!: MultiChr c v x) -> Int# -> LimitType (PointR i) -> PointR i -> Stream m (Elm (ls :!: MultiChr c v x) (PointR i)) Source #

(TermStreamContext m ps ts s x0 i0 is (PointL O), KnownNat c) => TermStream m (ps :. OStatic d :: Type) (TermSymbol ts (MultiChr c v x)) s (is :. PointL O) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

Methods

termStream :: Proxy (ps :. OStatic d) -> TermSymbol ts (MultiChr c v x) -> LimitType (is :. PointL O) -> (is :. PointL O) -> Stream m (TermState s Z Z) -> Stream m (TermState s (is :. PointL O) (TermArg (TermSymbol ts (MultiChr c v x)))) Source #

(TermStreamContext m ps ts s x0 i0 is (PointL I), KnownNat c) => TermStream m (ps :. IStatic d :: Type) (TermSymbol ts (MultiChr c v x)) s (is :. PointL I) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

Methods

termStream :: Proxy (ps :. IStatic d) -> TermSymbol ts (MultiChr c v x) -> LimitType (is :. PointL I) -> (is :. PointL I) -> Stream m (TermState s Z Z) -> Stream m (TermState s (is :. PointL I) (TermArg (TermSymbol ts (MultiChr c v x)))) Source #

(TermStreamContext m ps ts s x0 i0 is (PointR I), KnownNat c) => TermStream m (ps :. IVariable d :: Type) (TermSymbol ts (MultiChr c v x)) s (is :. PointR I) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

Methods

termStream :: Proxy (ps :. IVariable d) -> TermSymbol ts (MultiChr c v x) -> LimitType (is :. PointR I) -> (is :. PointR I) -> Stream m (TermState s Z Z) -> Stream m (TermState s (is :. PointR I) (TermArg (TermSymbol ts (MultiChr c v x)))) Source #

(TermStreamContext m ps ts s x0 i0 is (PointR I), KnownNat c) => TermStream m (ps :. IStatic d :: Type) (TermSymbol ts (MultiChr c v x)) s (is :. PointR I) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

Methods

termStream :: Proxy (ps :. IStatic d) -> TermSymbol ts (MultiChr c v x) -> LimitType (is :. PointR I) -> (is :. PointR I) -> Stream m (TermState s Z Z) -> Stream m (TermState s (is :. PointR I) (TermArg (TermSymbol ts (MultiChr c v x)))) Source #

KnownNat c => TermStaticVar (IVariable d :: Type) (MultiChr c v x) (PointR I) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

KnownNat c => TermStaticVar (IStatic d :: Type) (MultiChr c v x) (PointL I) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

KnownNat c => TermStaticVar (IStatic d :: Type) (MultiChr c v x) (PointR I) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

TermStaticVar (OStatic d :: Type) (MultiChr c v x) (PointL O) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

(Show i, Show (RunningIndex i), Show (v x), Show (Elm ls i)) => Show (Elm (ls :!: MultiChr c v x) i) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

Methods

showsPrec :: Int -> Elm (ls :!: MultiChr c v x) i -> ShowS #

show :: Elm (ls :!: MultiChr c v x) i -> String #

showList :: [Elm (ls :!: MultiChr c v x) i] -> ShowS #

Element ls i => Element (ls :!: MultiChr c v x) i Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

Associated Types

data Elm (ls :!: MultiChr c v x) i :: Type Source #

type RecElm (ls :!: MultiChr c v x) i :: Type Source #

type Arg (ls :!: MultiChr c v x) :: Type Source #

Methods

getArg :: Elm (ls :!: MultiChr c v x) i -> Arg (ls :!: MultiChr c v x) Source #

getIdx :: Elm (ls :!: MultiChr c v x) i -> RunningIndex i Source #

getElm :: Elm (ls :!: MultiChr c v x) i -> RecElm (ls :!: MultiChr c v x) i Source #

Build (MultiChr c v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

Associated Types

type Stack (MultiChr c v x) :: Type Source #

Methods

build :: MultiChr c v x -> Stack (MultiChr c v x) Source #

data Elm (ls :!: MultiChr c v x) i Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

data Elm (ls :!: MultiChr c v x) i = ElmMultiChr !(v x) !(RunningIndex i) !(Elm ls i)
type Arg (ls :!: MultiChr c v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

type Arg (ls :!: MultiChr c v x) = Arg ls :. v x
type LeftPosTy (IVariable d) (MultiChr c v x) (PointR I) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

type LeftPosTy (IVariable d) (MultiChr c v x) (PointR I) = IVariable (d + c)
type LeftPosTy (IStatic d) (MultiChr c v x) (PointR I) Source # 
Instance details

Defined in ADP.Fusion.PointR.Term.MultiChr

type LeftPosTy (IStatic d) (MultiChr c v x) (PointR I) = IStatic (d + c)
type LeftPosTy (IStatic d) (MultiChr c v x) (PointL I) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

type LeftPosTy (IStatic d) (MultiChr c v x) (PointL I) = IStatic d
type LeftPosTy (OStatic d) (MultiChr c v x) (PointL O) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.MultiChr

type LeftPosTy (OStatic d) (MultiChr c v x) (PointL O) = OStatic (d + c)
type Stack (MultiChr c v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

type Stack (MultiChr c v x) = S :!: MultiChr c v x
type TermArg (MultiChr c v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.MultiChr

type TermArg (MultiChr c v x) = v x

multiChr :: Vector v x => v x -> MultiChr c v x Source #

smart constructor for regular 1-character parsers