Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generalized fusion system for grammars.
This module re-exports only the core functionality.
NOTE Symbols typically do not check bound data for consistency. If you, say, bind a terminal symbol to an input of length 0 and then run your grammar, you probably get errors, garbled data or random crashes. Such checks are done via asserts in non-production code.
- (<<<) :: (RuleContext i, Build x, MkStream m (Stack x) i, Element (Stack x) i, Apply (Arg (Stack x) -> b)) => Fun (Arg (Stack x) -> b) -> x -> i -> i -> Stream m b
- (<<#) :: (RuleContext i, Build x, MkStream m (Stack x) i, Element (Stack x) i, Apply (Arg (Stack x) -> m b)) => Fun (Arg (Stack x) -> m b) -> x -> i -> i -> Stream m b
- (|||) :: Monad m => (t1 -> t -> Stream m a) -> (t1 -> t -> Stream m a) -> t1 -> t -> Stream m a
- (...) :: (t3 -> t2 -> t1) -> (t1 -> t) -> t3 -> t2 -> t
- (~~) :: a -> b -> Pair a b
- (%) :: a -> b -> Pair a b
- module ADP.Fusion.Core.Apply
- module ADP.Fusion.Core.Classes
- module ADP.Fusion.Core.Multi
- module ADP.Fusion.Core.TH
- module ADP.Fusion.Core.TyLvlIx
- module ADP.Fusion.SynVar.Array.Type
- module ADP.Fusion.SynVar.Axiom
- module ADP.Fusion.SynVar.Backtrack
- module ADP.Fusion.SynVar.Fill
- module ADP.Fusion.SynVar.Indices.Classes
- module ADP.Fusion.SynVar.Recursive.Type
- module ADP.Fusion.SynVar.Split.Type
- module ADP.Fusion.SynVar.TableWrap
- module ADP.Fusion.Term.Chr.Type
- module ADP.Fusion.Term.Deletion.Type
- module ADP.Fusion.Term.Edge.Type
- module ADP.Fusion.Term.Epsilon.Type
- module ADP.Fusion.Term.PeekIndex.Type
- module ADP.Fusion.Term.Strng.Type
- module Data.Vector.Fusion.Stream.Monadic
- module Data.Vector.Fusion.Util
Documentation
(<<<) :: (RuleContext i, Build x, MkStream m (Stack x) i, Element (Stack x) i, Apply (Arg (Stack x) -> b)) => Fun (Arg (Stack x) -> b) -> x -> i -> i -> Stream m b infixl 8 Source #
Apply a function to symbols on the RHS of a production rule. Builds the
stack of symbols from xs
using build
, then hands this stack to
mkStream
together with the initial iniT
telling mkStream
that we are
in the "outer" position. Once the stream has been created, we map
getArg
to get just the arguments in the stack, and finally apply
the
function f
.
(<<#) :: (RuleContext i, Build x, MkStream m (Stack x) i, Element (Stack x) i, Apply (Arg (Stack x) -> m b)) => Fun (Arg (Stack x) -> m b) -> x -> i -> i -> Stream m b infixl 8 Source #
(|||) :: Monad m => (t1 -> t -> Stream m a) -> (t1 -> t -> Stream m a) -> t1 -> t -> Stream m a infixl 7 Source #
Combine two RHSs to give a choice between parses.
(...) :: (t3 -> t2 -> t1) -> (t1 -> t) -> t3 -> t2 -> t infixl 5 Source #
Applies the objective function h
to a stream s
. The objective function
reduces the stream to a single optimal value (or some vector of co-optimal
things).
(%) :: a -> b -> Pair a b infixl 9 Source #
This separator looks much paper "on paper" and is not widely used otherwise.
module ADP.Fusion.Core.Apply
module ADP.Fusion.Core.Classes
module ADP.Fusion.Core.Multi
module ADP.Fusion.Core.TH
module ADP.Fusion.Core.TyLvlIx
module ADP.Fusion.SynVar.Array.Type
module ADP.Fusion.SynVar.Axiom
module ADP.Fusion.SynVar.Backtrack
module ADP.Fusion.SynVar.Fill
module ADP.Fusion.SynVar.Split.Type
module ADP.Fusion.SynVar.TableWrap
module ADP.Fusion.Term.Chr.Type
module ADP.Fusion.Term.Edge.Type
module ADP.Fusion.Term.Epsilon.Type
module ADP.Fusion.Term.Strng.Type
module Data.Vector.Fusion.Util