lift
This module contains lift1
through lift22
, which allow for the application of a function of arity N
to N
parsers.
The combinators contained in this module all sequence a number of parsers together, but are capable of combining the results generated by these parsers into a single value with a given function of the correct arity. This is a clean way of putting together multiple parsers and getting a meaningful result out.
Attributes
- Since:
2.2.0
- Example:
scala> import parsley.character.char scala> import parsley.lift.{lift2, lift3} scala> case class Add(x: Int, y: Int) scala> val p = lift2(Add, char('a') #> 4, char('b') #> 5) scala> p.parse("ab") val res0 = Success(Add(4, 5)) scala> val q = lift3((x: Int, y: Int, z: Int) => x * y + z, char('a') #> 3, char('b') #> 2, char('c') #> 5) scala> q.parse("abc") val res1 = Success(11) scala> q.parse("ab") val res2 = Failure(..) scala> val q2 = lift3[Int, Int, Int, Int](_ * _ + _, char('a') #> 3, char('b') #> 2, char('c') #> 5)
- Source:
- lift.scala
- Graph
- Supertypes
- Self type
- lift.type
Members list
Value members
Concrete methods
This combinator allows the result of a given parser to be changed using a given function.
This combinator allows the result of a given parser to be changed using a given function.
Effectively alias for map
, to be consistent with the other lift
variants.
Attributes
- f
the function to map across the given parser
- Returns:
a parser that applies the function
f
to the result of the given parser.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity ten.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity eleven.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity twelve.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity thirteen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity fourteen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity fifteen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity sixteen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity seventeen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity eighteen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity nineteen.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity two.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity twenty.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity twenty-one.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity twenty-two.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity three.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity four.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity five.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity six.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity seven.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity eight.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
This combinator applies the given parsers in sequence and then applies the given function f
of to all of the results.
Firstly, each parser is parsed in turn, each producing a result. So long as all of the parsers succeeded,
the combinator can succeed by returning the application of the function f
to all the arguments. If any
of the parsers fails, the entire combinator fails.
Attributes
- f
a function to apply to the results of the parsers with arity nine.
- Returns:
a parser that parses all of the given parsers in order, and then combines their results with
f
.- Source:
- lift.scala