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

Safe HaskellNone
LanguageHaskell2010

ADP.Fusion.Core.Term.Str

Synopsis

Documentation

data Str (linked :: Maybe Symbol) (minSz :: Nat) (maxSz :: Maybe Nat) v x where Source #

A Str wraps an input vector and provides type-level annotations on linked Str's, their minimal and maximal size.

If linked ∷ Maybe Symbol is set to Just aName, then all Str's that are part of the same rule share their size information. This allows rules of the kind X -> a Y b where a,b have a common maximal size.

minSz and maxSz provide minimal and maximal parser width, if set.

TODO consider if maxSz could do with just Nat

Constructors

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

Defined in ADP.Fusion.PointL.Term.Str

Methods

mkStream :: Proxy pos -> (ls :!: Str linked minSz maxSz v x) -> Int# -> LimitType (PointL i) -> PointL i -> Stream m (Elm (ls :!: Str linked minSz maxSz v x) (PointL i)) Source #

TermStreamContext m ps ts s x0 i0 is (PointL I) => TermStream m (ps :. IStatic d :: Type) (TermSymbol ts (Str (Nothing :: Maybe Symbol) minSz (Nothing :: Maybe Nat) v x)) s (is :. PointL I) Source #

Note that the minSz should automatically work out due to the encoding in d.

Instance details

Defined in ADP.Fusion.PointL.Term.Str

Methods

termStream :: Proxy (ps :. IStatic d) -> TermSymbol ts (Str Nothing minSz Nothing 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 (Str Nothing minSz Nothing v x)))) Source #

KnownNat minSz => TermStaticVar (IStatic d :: Type) (Str (Nothing :: Maybe Symbol) minSz (Nothing :: Maybe Nat) v x) (PointL I) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.Str

(Show i, Show (RunningIndex i), Show (v x), Show (Elm ls i)) => Show (Elm (ls :!: Str linked minSz maxSz v x) i) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

Methods

showsPrec :: Int -> Elm (ls :!: Str linked minSz maxSz v x) i -> ShowS #

show :: Elm (ls :!: Str linked minSz maxSz v x) i -> String #

showList :: [Elm (ls :!: Str linked minSz maxSz v x) i] -> ShowS #

(Element ls i, Vector v x) => Element (ls :!: Str linked minSz maxSz v x) i Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

Associated Types

data Elm (ls :!: Str linked minSz maxSz v x) i :: Type Source #

type RecElm (ls :!: Str linked minSz maxSz v x) i :: Type Source #

type Arg (ls :!: Str linked minSz maxSz v x) :: Type Source #

Methods

getArg :: Elm (ls :!: Str linked minSz maxSz v x) i -> Arg (ls :!: Str linked minSz maxSz v x) Source #

getIdx :: Elm (ls :!: Str linked minSz maxSz v x) i -> RunningIndex i Source #

getElm :: Elm (ls :!: Str linked minSz maxSz v x) i -> RecElm (ls :!: Str linked minSz maxSz v x) i Source #

Build (Str linked minSz maxSz v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

Associated Types

type Stack (Str linked minSz maxSz v x) :: Type Source #

Methods

build :: Str linked minSz maxSz v x -> Stack (Str linked minSz maxSz v x) Source #

data Elm (ls :!: Str linked minSz maxSz v x) i Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

data Elm (ls :!: Str linked minSz maxSz v x) i = ElmStr !(v x) !(RunningIndex i) !(Elm ls i)
type Arg (ls :!: Str linked minSz maxSz v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

type Arg (ls :!: Str linked minSz maxSz v x) = Arg ls :. v x
type LeftPosTy (IVariable d) (Str linked minSz maxSz v x) (PointL I) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.Str

type LeftPosTy (IVariable d) (Str linked minSz maxSz v x) (PointL I) = IVariable d
type LeftPosTy (IStatic d) (Str linked minSz maxSz v x) (PointL I) Source # 
Instance details

Defined in ADP.Fusion.PointL.Term.Str

type LeftPosTy (IStatic d) (Str linked minSz maxSz v x) (PointL I) = IVariable d
type Stack (Str linked minSz maxSz v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

type Stack (Str linked minSz maxSz v x) = S :!: Str linked minSz maxSz v x
type TermArg (Str linked minSz maxSz v x) Source # 
Instance details

Defined in ADP.Fusion.Core.Term.Str

type TermArg (Str linked minSz maxSz v x) = v x

manyV :: Vector v x => v x -> Str Nothing 0 Nothing v x Source #

Construct string parsers with no special constraints.

someV :: Vector v x => v x -> Str Nothing 1 Nothing v x Source #