Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data OutsideContext s
- = OStatic s
- | ORightOf s
- | OFirstLeft s
- | OLeftOf s
- data InsideContext s
- data ComplementContext = Complemented
- class RuleContext i where
- type Context i :: *
- initialContext :: i -> Context i
- class Element x i where
- class Monad m => MkStream m x i where
- class Build x where
- data S = S
- staticCheck :: Monad m => Bool -> Stream m a -> Stream m a
- data StaticCheck a b
- = CheckLeft a
- | CheckRight b
- data TableConstraint
- minSize :: TableConstraint -> Int
- class ModifyConstraint t where
- toNonEmpty :: t -> t
- toEmpty :: t -> t
- type family TblConstraint x :: *
Documentation
data OutsideContext s Source
OStatic s | |
ORightOf s | |
OFirstLeft s | |
OLeftOf s |
data InsideContext s Source
class RuleContext i where Source
initialContext :: i -> Context i Source
RuleContext Subword | |
RuleContext BitSet | |
RuleContext PointL | |
RuleContext Z | |
RuleContext (Outside Subword) | |
RuleContext (Outside BitSet) | |
RuleContext (Outside (BS2I First Last)) | |
RuleContext (Outside PointL) | |
RuleContext (Outside Z) | |
(RuleContext (Outside is), RuleContext (Outside i)) => RuleContext (Outside ((:.) is i)) | |
RuleContext (Complement Subword) | |
RuleContext (Complement BitSet) | |
RuleContext (Complement (BS2I First Last)) | |
RuleContext (Complement PointL) | |
RuleContext (BS2I First Last) | |
(RuleContext is, RuleContext i) => RuleContext ((:.) is i) |
class Element x i where Source
During construction of the stream, we need to extract individual elements
from symbols in production rules. An element in a stream is fixed by both,
the type x
of the actual argument we want to grab (say individual
characters we parse from an input) and the type of indices i
we use.
Elm
data constructors are all eradicated during fusion and should never
show up in CORE.
Element S i | |
Element ls i => Element ((:!:) ls (TermSymbol a b)) i | |
Element ls i => Element ((:!:) ls (Backtrack (ITbl mF arr j x) mF mB r)) i | |
Element ls i => Element ((:!:) ls (ITbl m arr j x)) i | |
Element ls i => Element ((:!:) ls (Backtrack (IRec mF i x) mF mB r)) i | |
Element ls i => Element ((:!:) ls (IRec m i x)) i | |
Element ls i => Element ((:!:) ls (Split uId splitType (Backtrack (ITbl mF arr j x) mF mB r))) i | |
Element ls i => Element ((:!:) ls (Split uId splitType (ITbl m arr j x))) i | |
Element ls i => Element ((:!:) ls (Chr r x)) i | |
Element ls i => Element ((:!:) ls Deletion) i | |
Element ls i => Element ((:!:) ls (Edge e)) i | |
Element ls i => Element ((:!:) ls Epsilon) i | |
Element ls i => Element ((:!:) ls (PeekIndex i)) i | |
Element ls i => Element ((:!:) ls (Strng v x)) i |
class Monad m => MkStream m x i where Source
mkStream
creates the actual stream of elements (Elm
) that will be fed
to functions on the left of the (<<<)
operator. Streams work over all
monads and are specialized for each combination of arguments x
and indices
i
.
Finally, we need to be able to correctly build together symbols on the
right-hand side of the (<<<)
operator.
The default makes sure that the last (or only) argument left over is
correctly assigned a Z
to terminate the symbol stack.
Nothing
Similar to Z
, but terminates an argument stack.
staticCheck :: Monad m => Bool -> Stream m a -> Stream m a Source
staticCheck
acts as a static filter. If b
is true, we keep all stream
elements. If b
is false, we discard all stream elements.
data StaticCheck a b Source
CheckLeft a | |
CheckRight b |
data TableConstraint Source
minSize :: TableConstraint -> Int Source
class ModifyConstraint t where Source
toNonEmpty :: t -> t Source
ModifyConstraint (Backtrack (ITbl mF arr Subword x) mF mB r) | |
ModifyConstraint (ITbl m arr Subword x) |
type family TblConstraint x :: * Source
type TblConstraint Subword = TableConstraint | |
type TblConstraint BitSet = TableConstraint | |
type TblConstraint PointL = TableConstraint | |
type TblConstraint PointR = TableConstraint | |
type TblConstraint Z = Z | |
type TblConstraint (Outside o) = TblConstraint o | |
type TblConstraint (Complement o) = TblConstraint o | |
type TblConstraint ((:>) ((:>) BitSet (Interface i)) (Interface j)) = TableConstraint | |
type TblConstraint ((:.) is i) = (:.) (TblConstraint is) (TblConstraint i) |