public class ApplyBuilder extends Object
ApplyBuilder
combines parsers via successive calls to and
and andL
.
ApplyBuilder
provides a fluent interface for combining parsers.
The first two parsers are combined by a calling Parser.map
,
which returns an ApplyBuilder
instance.
Each successive parser is incorporated by passing it to a call to and
or andL
.
The chain of calls is concluded by calling map
with a handler for the parse results.
ApplyBuilder is a more readable way of using Parser.ap
.
For example, pa.and(pb).and(pc).map(f)
is equivalent to ap(ap(ap(pa.map(f), pb), pc), pd)
.
Modifier and Type | Class and Description |
---|---|
static class |
ApplyBuilder._2<I,A,B> |
Constructor and Description |
---|
ApplyBuilder() |
public ApplyBuilder()
Copyright © 2019. All rights reserved.