Packages

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
Linear Supertypes
(In) => Result[Out, A, X], AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rule
  2. Function1
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def apply(v1: In): Result[Out, A, X]
    Definition Classes
    Function1
  2. abstract val factory: Rules

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. def !^[Y](fx2y: (X) => Y): Rule[In, Out, A, Y]

    Maps an Error

  3. final def ##: Int
    Definition Classes
    AnyRef → Any
  4. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toany2stringadd[Rule[In, Out, A, X]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  5. def -[In2 <: In](exclude: => Rule[In2, Any, Any, Any]): Rule[In2, Out, A, X]
  6. def ->[B](y: B): (Rule[In, Out, A, X], B)
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toArrowAssoc[Rule[In, Out, A, X]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. def -^[B](b: B): Rule[In, Out, B, X]
  8. def -~[Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, B, X2]
  9. def -~![Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, B, Any]
  10. 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

  11. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def >->[Out2, B, X2 >: X](fa2resultb: (A) => Result[Out2, B, X2]): Rule[In, Out2, B, X2]
  13. def >>[Out2, B, X2 >: X](fa2ruleb: (A) => (Out) => Result[Out2, B, X2]): Rule[In, Out2, B, X2]
  14. def >>&[B, X2 >: X](fa2ruleb: (A) => (Out) => Result[Any, B, X2]): Rule[In, Out, B, X2]
  15. def >>?[Out2, B, X2 >: X](pf: PartialFunction[A, Rule[Out, Out2, B, X2]]): Rule[In, Out2, B, X2]
  16. def >~>[Out2, B1, B2, B >: A, C, X2 >: X](f: (B1, B2) => (Out) => Result[Out2, C, X2])(implicit viewbound_0: (B) => ~[B1, B2]): Rule[In, Out2, C, X2]

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

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

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

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

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

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

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

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

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

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

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

  25. def ^~~~~^[B1, B2, B3, B4, B5, B >: A, C](f: (B1, B2, B3, B4, B5) => C)(implicit viewbound_0: (B) => ~[~[~[~[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) }

  26. def ^~~~~~^[B1, B2, B3, B4, B5, B6, B >: A, C](f: (B1, B2, B3, B4, B5, B6) => C)(implicit viewbound_0: (B) => ~[~[~[~[~[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) }

  27. def ^~~~~~~^[B1, B2, B3, B4, B5, B6, B7, B >: A, C](f: (B1, B2, B3, B4, B5, B6, B7) => C)(implicit viewbound_0: (B) => ~[~[~[~[~[~[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) }

  28. def andThen[A](g: (Result[Out, A, X]) => A): (In) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  29. def as(name: String): Rule[In, Out, A, X] with Name
  30. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  31. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  32. def compose[A](g: (A) => In): (A) => Result[Out, A, X]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  33. def ensuring(cond: (Rule[In, Out, A, X]) => Boolean, msg: => Any): Rule[In, Out, A, X]
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toEnsuring[Rule[In, Out, A, X]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  34. def ensuring(cond: (Rule[In, Out, A, X]) => Boolean): Rule[In, Out, A, X]
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toEnsuring[Rule[In, Out, A, X]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  35. def ensuring(cond: Boolean, msg: => Any): Rule[In, Out, A, X]
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toEnsuring[Rule[In, Out, A, X]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  36. def ensuring(cond: Boolean): Rule[In, Out, A, X]
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toEnsuring[Rule[In, Out, A, X]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  37. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  39. def filter(f: (A) => Boolean): Rule[In, Out, A, X]
  40. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  41. def flatMap[Out2, B, X2 >: X](fa2ruleb: (A) => (Out) => Result[Out2, B, X2]): Rule[In, Out2, B, X2]
  42. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  44. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  45. def map[B](fa2b: (A) => B): Rule[In, Out, B, X]
  46. def mapResult[Out2, B, Y](f: (Result[Out, A, X]) => Result[Out2, B, Y]): Rule[In, Out2, B, Y]
  47. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  50. def orElse[In2 <: In, Out2 >: Out, A2 >: A, X2 >: X](other: => Rule[In2, Out2, A2, X2]): Rule[In2, Out2, A2, X2]
  51. def orError[In2 <: In]: Rule[In, Out, A, Any]
  52. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  53. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  54. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  55. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  56. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  57. def |[In2 <: In, Out2 >: Out, A2 >: A, X2 >: X](other: => Rule[In2, Out2, A2, X2]): Rule[In2, Out2, A2, X2]
  58. def ~[Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, ~[A, B], X2]
  59. def ~![Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, ~[A, B], Any]
  60. def ~++[Out2, B >: A, X2 >: X](next: => Rule[Out, Out2, Seq[B], X2]): Rule[In, Out2, collection.immutable.List[B], X2]
  61. def ~-[Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, A, X2]
  62. def ~-![Out2, B, X2 >: X](next: => Rule[Out, Out2, B, X2]): Rule[In, Out2, A, Any]
  63. 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

Deprecated Value Members

  1. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toStringFormat[Rule[In, Out, A, X]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  2. def [B](y: B): (Rule[In, Out, A, X], B)
    Implicit
    This member is added by an implicit conversion from Rule[In, Out, A, X] toArrowAssoc[Rule[In, Out, A, X]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from (In) => Result[Out, A, X]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromRule[In, Out, A, X] to any2stringadd[Rule[In, Out, A, X]]

Inherited by implicit conversion StringFormat fromRule[In, Out, A, X] to StringFormat[Rule[In, Out, A, X]]

Inherited by implicit conversion Ensuring fromRule[In, Out, A, X] to Ensuring[Rule[In, Out, A, X]]

Inherited by implicit conversion ArrowAssoc fromRule[In, Out, A, X] to ArrowAssoc[Rule[In, Out, A, X]]

Ungrouped