public final class Result<I,A>
extends java.lang.Object
implements java.lang.Iterable<A>
Modifier and Type | Method and Description |
---|---|
<B,J> F<F<I,J>,F<F<A,B>,Result<J,B>>> |
bimap()
First-class bifunctor map.
|
<B,J> Result<J,B> |
bimap(F<I,J> f,
F<A,B> g)
A bifunctor map across both the remainder of the parse input and the parse value.
|
java.util.Iterator<A> |
iterator()
Returns an iterator over the parse value.
|
<J> F<F<I,J>,Result<J,A>> |
mapRest()
First-class function mapping across the remainder of the parse input.
|
<J> Result<J,A> |
mapRest(F<I,J> f)
Maps the given function across the remainder of the parse input.
|
<B> F<F<A,B>,Result<I,B>> |
mapValue()
First-class function mapping across the parse value.
|
<B> Result<I,B> |
mapValue(F<A,B> f)
Maps the given function across the parse value.
|
I |
rest()
The remainder of the parse input.
|
static <A,I> F<I,F<A,Result<I,A>>> |
result()
First-class construction of a result.
|
static <A,I> Result<I,A> |
result(I i,
A a)
Construct a result with the given remainder of the parse input and parse value.
|
A |
value()
The parsed value.
|
public I rest()
public A value()
public <J> Result<J,A> mapRest(F<I,J> f)
f
- The function to map with.public <J> F<F<I,J>,Result<J,A>> mapRest()
public <B> Result<I,B> mapValue(F<A,B> f)
f
- The function to map with.public <B> F<F<A,B>,Result<I,B>> mapValue()
public <B,J> Result<J,B> bimap(F<I,J> f, F<A,B> g)
f
- The function to map the remainder of the parse input with.g
- The function to map the parse value with.public <B,J> F<F<I,J>,F<F<A,B>,Result<J,B>>> bimap()
public java.util.Iterator<A> iterator()
for
-each loop.iterator
in interface java.lang.Iterable<A>
public static <A,I> Result<I,A> result(I i, A a)
i
- The remainder of the parse input.a
- The parse value.