RefMaker

parsley.state.RefMaker
final implicit class RefMaker[A](val x: A) extends AnyVal

This class, when in scope, enables a method to create and fill a reference with a given value.

Value parameters

x

the value to initialise a reference with.

Attributes

Constructor

This constructor should not be called manually, it is designed to be used via Scala's implicit resolution.

Source
state.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def makeRef[B](body: Ref[A] => Parsley[B]): Parsley[B]

This combinator fills a fresh reference with the this value.

This combinator fills a fresh reference with the this value.

This allows for a more controlled way of creating references during a parse, without explicitly creating them with Ref.make[A] and using set. These references are intended to be fresh every time they are "created", in other words, a recursive call with a makeRef call inside will modify a different reference.

Value parameters

body

a function to generate a parser that can interact with the freshly created reference.

Attributes

See also

fillRef for a version that uses the result of a parser to fill the reference instead.

Since

4.0.0

Source
state.scala

Concrete fields

val x: A

Attributes

Source
state.scala