| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
ADP.Fusion.Core.Classes
- data OutsideContext s
- = OStatic s
- | ORightOf s
- | OFirstLeft s
- | OLeftOf s
- data InsideContext s
- = IStatic {
- iGetContext :: s
- | IVariable {
- iGetContext :: s
- = IStatic {
- data ComplementContext = Complemented
- data ExtComplementContext s
- class RuleContext i where
- data family RunningIndex 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 Bool a
- | CheckRight b
- staticCheck# :: Monad m => Int# -> Stream m a -> Stream m a
- data SLR z
- data EmptyOk = EmptyOk
- data NonEmpty = NonEmpty
- class MinSize c where
- class ModifyConstraint t where
Documentation
data OutsideContext s Source #
Constructors
| OStatic s | |
| ORightOf s | |
| OFirstLeft s | |
| OLeftOf s |
Instances
| Show s => Show (OutsideContext s) Source # | |
data InsideContext s Source #
Constructors
| IStatic | |
Fields
| |
| IVariable | |
Fields
| |
Instances
| Show s => Show (InsideContext s) Source # | |
data ExtComplementContext s Source #
Needed for structures that have long-range interactions and "expand",
like sets around edge boundaries: set edge set. requires the sets to
be connected.
class RuleContext i where Source #
Minimal complete definition
Methods
initialContext :: i -> Context i Source #
data family RunningIndex i :: * Source #
While we ostensibly use an index of type i we typically do not need
every element of an i. For example, when looking at Subwords, we do
not need both element of j:.k but only k.
Also, inside grammars do need fewer moving indices than outside
grammars.
TODO Sometimes, the actual RunningIndex ctors are not erased. This could
be due to https://ghc.haskell.org/trac/ghc/ticket/2289. To test, we
should transform RunningIndex into a type class to give us access to the
left and right member, also we should create instances a la
RunningIndex (is :. Subword I) = RiSwI !(RunningIndex is) !Int.
Hopefully, these are completely erased.
Instances
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.
Instances
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.
Minimal complete definition
Instances
| (Monad m, MkStream m ls i, Element ls i, TermStaticVar (TermSymbol a b) i, TermStream m (TermSymbol a b) (Elm ls i) i) => MkStream m ((:!:) ls (TermSymbol a b)) i Source # | |
| (Monad mB, Element ls ((:.) is i), TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i), AddIndexDense (Elm ls ((:.) is i)) ((:.) us u) ((:.) cs c) ((:.) is i), MkStream mB ls ((:.) is i), PrimArrayOps arr ((:.) us u) x) => MkStream mB ((:!:) ls (TwITblBt arr ((:.) cs c) ((:.) us u) x mF mB r)) ((:.) is i) Source # | |
| (Monad m, Element ls ((:.) is i), TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i), AddIndexDense (Elm ls ((:.) is i)) ((:.) us u) ((:.) cs c) ((:.) is i), MkStream m ls ((:.) is i), PrimArrayOps arr ((:.) us u) x) => MkStream m ((:!:) ls (TwITbl m arr ((:.) cs c) ((:.) us u) x)) ((:.) is i) Source # | |
| (Applicative mB, Monad mB, Element ls ((:.) is i), TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i), AddIndexDense (Elm ls ((:.) is i)) ((:.) us u) ((:.) cs c) ((:.) is i), MkStream mB ls ((:.) is i)) => MkStream mB ((:!:) ls (TwIRecBt ((:.) cs c) ((:.) us u) x mF mB r)) ((:.) is i) Source # | |
| (Functor m, Monad m, Element ls ((:.) is i), TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i), AddIndexDense (Elm ls ((:.) is i)) ((:.) us u) ((:.) cs c) ((:.) is i), MkStream m ls ((:.) is i)) => MkStream m ((:!:) ls (TwIRec m ((:.) cs c) ((:.) us u) x)) ((:.) is i) Source # | |
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.
Instances
| Build Deletion Source # | |
| Build Edge Source # | |
| Build Epsilon Source # | |
| Build (PeekIndex i) Source # | |
| Build x => Build ((:!:) x y) Source # | |
| Build (TermSymbol a b) Source # | |
| Build (Chr r x) Source # | |
| Build (Strng v x) Source # | |
| Build (Split uId splitType synVar) Source # | |
| Build (TwIRec m c i x) Source # | |
| Build (TwITbl m arr c i x) Source # | |
| Build (TwIRecBt c i x mF mB r) Source # | |
| Build (TwITblBt arr c i x mF mB r) Source # | |
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 #
Constructors
| CheckLeft Bool a | |
| CheckRight b |
Constrains the behaviour of the memoizing tables. They may be EmptyOk if
i==j is allowed (empty subwords or similar); or they may need NonEmpty
indices, or finally they can be OnlyZero (only i==j allowed) which is
useful in multi-dimensional casese.
Constructors
| EmptyOk |