Rule

trait Rule[-In, +Out, +A, +X] extends In => Result[Out, A, X]

A Rule is a function from some input to a Result. The result may be:

  • Success, with a value of some type and an output that may serve as the input to subsequent rules.

  • Failure. A failure may result in some alternative rule being applied.

  • Error. No further rules should be attempted.

Source:
Rule.scala
trait In => Result[Out, A, X]
class Object
trait Matchable
class Any
trait Choice[In, Out, A, X]
class DefaultRule[In, Out, A, X]

Value members

Concrete methods

def !^[Y](fx2y: X => Y): Rule[In, Out, A, Y]

Maps an Error

Maps an Error

Source:
Rule.scala
def -[In2 <: In](exclude: => Rule[In2, Any, Any, Any]): Rule[In2, Out, A, X]
Source:
Rule.scala
def -^[B](b: B): Rule[In, Out, B, X]
Source:
Rule.scala
def -~[Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, B, X2]
Source:
Rule.scala
def -~![Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, B, Any]
Source:
Rule.scala
def <~:[InPrev, B, X2 >: X](prev: => Rule[InPrev, In, A => B, X2]): Rule[InPrev, Out, B, X2]

Apply the result of this rule to the function returned by the previous rule

Apply the result of this rule to the function returned by the previous rule

Source:
Rule.scala
def >->[Out2, B, X2 >: X](fa2resultb: A => Result[Out2, B, X2]): Rule[In, Out2, B, X2]
Source:
Rule.scala
def >>[Out2, B, X2 >: X](fa2ruleb: A => Out => Result[Out2, B, X2]): Rule[In, Out2, B, X2]
Source:
Rule.scala
def >>&[B, X2 >: X](fa2ruleb: A => Out => Result[Any, B, X2]): Rule[In, Out, B, X2]
Source:
Rule.scala
def >>?[Out2, B, X2 >: X](pf: PartialFunction[A, Rule[Out, Out2, B, X2]]): Rule[In, Out2, B, X2]
Source:
Rule.scala
def >~>[Out2, B1, B2, B >: A, C, X2 >: X](f: (B1, B2) => Out => Result[Out2, C, X2])(implicit A: A => B1 ~ B2): Rule[In, Out2, C, X2]

~>(f) is equivalent to >> { case b1 ~ b2 => f(b1, b2) }

Source:
Rule.scala
def ??(pf: PartialFunction[A, Any]): Rule[In, Out, A, X]
Source:
Rule.scala
def ^-^[B1, B2 >: A, C](f: (B1, B2) => C): Rule[In, Out, B1 => C, X]

^-^(f) is equivalent to ^^ { b2 => b1 => f(b1, b2) }

^-^(f) is equivalent to ^^ { b2 => b1 => f(b1, b2) }

Source:
Rule.scala
def ^^[B](fa2b: A => B): Rule[In, Out, B, X]
Source:
Rule.scala
def ^^?[B](pf: PartialFunction[A, B]): Rule[In, Out, B, X]
Source:
Rule.scala
def ^~>~^[B1, B2, B3, B >: A, C](f: (B1, B2, B3) => C)(implicit A: A => B2 ~ B3): Rule[In, Out, B1 => C, X]

^~>~^(f) is equivalent to ^^ { case b2 ~ b3 => b1 => f(b1, b2, b3) }

^~>~^(f) is equivalent to ^^ { case b2 ~ b3 => b1 => f(b1, b2, b3) }

Source:
Rule.scala
def ^~^[B1, B2, B >: A, C](f: (B1, B2) => C)(implicit A: A => B1 ~ B2): Rule[In, Out, C, X]

^~^(f) is equivalent to ^^ { case b1 ~ b2 => f(b1, b2) }

^~^(f) is equivalent to ^^ { case b1 ~ b2 => f(b1, b2) }

Source:
Rule.scala
def ^~~^[B1, B2, B3, B >: A, C](f: (B1, B2, B3) => C)(implicit A: A => B1 ~ B2 ~ B3): Rule[In, Out, C, X]

^~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 => f(b1, b2, b3) }

^~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 => f(b1, b2, b3) }

Source:
Rule.scala
def ^~~~^[B1, B2, B3, B4, B >: A, C](f: (B1, B2, B3, B4) => C)(implicit A: A => B1 ~ B2 ~ B3 ~ B4): Rule[In, Out, C, X]

^~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 => f(b1, b2, b3, b4) }

^~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 => f(b1, b2, b3, b4) }

Source:
Rule.scala
def ^~~~~^[B1, B2, B3, B4, B5, B >: A, C](f: (B1, B2, B3, B4, B5) => C)(implicit A: A => B1 ~ B2 ~ B3 ~ B4 ~ B5): Rule[In, Out, C, X]

^~~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 ~ b5 => f(b1, b2, b3, b4, b5) }

^~~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 ~ b5 => f(b1, b2, b3, b4, b5) }

Source:
Rule.scala
def ^~~~~~^[B1, B2, B3, B4, B5, B6, B >: A, C](f: (B1, B2, B3, B4, B5, B6) => C)(implicit A: A => B1 ~ B2 ~ B3 ~ B4 ~ B5 ~ B6): Rule[In, Out, C, X]

^~~~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 ~ b5 ~ b6 => f(b1, b2, b3, b4, b5, b6) }

^~~~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 ~ b5 ~ b6 => f(b1, b2, b3, b4, b5, b6) }

Source:
Rule.scala
def ^~~~~~~^[B1, B2, B3, B4, B5, B6, B7, B >: A, C](f: (B1, B2, B3, B4, B5, B6, B7) => C)(implicit A: A => B1 ~ B2 ~ B3 ~ B4 ~ B5 ~ B6 ~ B7): Rule[In, Out, C, X]

^~~~~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 ~ b5 ~ b6 => f(b1, b2, b3, b4, b5, b6) }

^~~~~~~^(f) is equivalent to ^^ { case b1 ~ b2 ~ b3 ~ b4 ~ b5 ~ b6 => f(b1, b2, b3, b4, b5, b6) }

Source:
Rule.scala
def as(name: String): Rule[In, Out, A, X] & Name
Source:
Rule.scala
def filter(f: A => Boolean): Rule[In, Out, A, X]
Source:
Rule.scala
def flatMap[Out2, B, X2 >: X](fa2ruleb: A => Out => Result[Out2, B, X2]): Rule[In, Out2, B, X2]
Source:
Rule.scala
def map[B](fa2b: A => B): Rule[In, Out, B, X]
Source:
Rule.scala
def mapResult[Out2, B, Y](f: Result[Out, A, X] => Result[Out2, B, Y]): Rule[In, Out2, B, Y]
Source:
Rule.scala
def orElse[In2 <: In, Out2 >: Out, A2 >: A, X2 >: X](other: => Rule[In2, Out2, A2, X2]): Rule[In2, Out2, A2, X2]
Source:
Rule.scala
def orError[In2 <: In]: Rule[In, Out, A, Any]
Source:
Rule.scala
def |[In2 <: In, Out2 >: Out, A2 >: A, X2 >: X](other: => Rule[In2, Out2, A2, X2]): Rule[In2, Out2, A2, X2]
Source:
Rule.scala
def ~[Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, A ~ B, X2]
Source:
Rule.scala
def ~![Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, A ~ B, Any]
Source:
Rule.scala
def ~++[Out2, B >: A, X2 >: X](next: => Rule[Out, Out2, Seq[B], X2]): Rule[In, Out2, List[B], X2]
Source:
Rule.scala
def ~-[Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, A, X2]
Source:
Rule.scala
def ~-![Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, A, Any]
Source:
Rule.scala
def ~>[Out2, B, X2 >: X](next: => Rule[Out, Out2, A => B, X2]): Rule[In, Out2, B, X2]

Apply the result of this rule to the function returned by the next rule

Apply the result of this rule to the function returned by the next rule

Source:
Rule.scala

Inherited methods

@unspecialized
def andThen[A](g: Result[Out, A, X] => A): In => A
Inherited from:
Function1
def apply(v1: In): Result[Out, A, X]
Inherited from:
Function1
@unspecialized
def compose[A](g: A => In): A => Result[Out, A, X]
Inherited from:
Function1
override def toString(): String
Definition Classes
Function1 -> Any
Inherited from:
Function1

Abstract fields