We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Really, the interface should be an applicative functor. The idea would be:
interface Parser { ... fn apply<P>(self, p: P) -> Apply<Self, P> { ... } ... } impl<P,Q,Str> Uncommitted<Str> for Apply<P,Q> where P: Uncommitted<Str>, Q: Committed<Str>, P::Output: Function<Q::Output>, { ... }
so you could write something like:
character(...).emitting(myfun).apply(this).apply(that);
This would support Kleene Star as well, with something like:
interface Parser { ... fn apply_star<P>(self, p: P) -> ApplyStar<Self, P> { ... } ... } impl<P,Q,Str> Uncommitted<Str> for ApplyStar<P,Q> where P: Uncommitted<Str>, Q: Uncommitted<Str>, P::Output: Function<Q::Output, Output = P::Output>, { ... }
For example, the current p.star(f) would be:
p.star(f)
emit(f).apply_star(p)
and the current p.plus(f) would be:
p.plus(f)
p.map(|x| f().apply(x)).apply_star(p)
this uses F: FnOnce(X) -> F as a replacement for Consumer<F>.
F: FnOnce(X) -> F
Consumer<F>
The text was updated successfully, but these errors were encountered:
asajeffrey
No branches or pull requests
Really, the interface should be an applicative functor. The idea would be:
so you could write something like:
This would support Kleene Star as well, with something like:
For example, the current
p.star(f)
would be:and the current
p.plus(f)
would be:this uses
F: FnOnce(X) -> F
as a replacement forConsumer<F>
.The text was updated successfully, but these errors were encountered: