# 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
Linear Supertypes
(In) ⇒ Result[Out, A, X], AnyRef, Any
Known Subclasses
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. Rule
2. Function1
3. AnyRef
4. Any
Implicitly
2. by any2stringfmt
3. by any2ArrowAssoc
4. by any2Ensuring
1. Hide All
2. Show all
Visibility
1. Public
2. All

### Abstract Value Members

1. #### abstract def apply(v1: In): Result[Out, A, X]

Definition Classes
Function1

### Concrete Value Members

1. #### final def !=(arg0: AnyRef): Boolean

Definition Classes
AnyRef
2. #### final def !=(arg0: Any): Boolean

Definition Classes
Any
3. #### def !^[Y](fx2y: (X) ⇒ Y): Rule[In, Out, A, Y]

Maps an Error

4. #### final def ##(): Int

Definition Classes
AnyRef → Any
5. #### def +(other: String): String

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to StringAdd performed by method any2stringadd in scala.Predef.
Definition Classes

7. #### def ->[B](y: B): (Rule[In, Out, A, X], B)

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to ArrowAssoc[Rule[In, Out, A, X]] performed by method any2ArrowAssoc in scala.Predef.
Definition Classes
ArrowAssoc
Annotations
@inline()

11. #### 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

12. #### final def ==(arg0: AnyRef): Boolean

Definition Classes
AnyRef
13. #### final def ==(arg0: Any): Boolean

Definition Classes
Any

18. #### def >~>[Out2, B1, B2, B >: A, C, X2 >: X](f: (B1, B2) ⇒ (Out) ⇒ Result[Out2, C, X2])(implicit arg0: (B) ⇒ ~[B1, B2]): Rule[In, Out2, C, X2]

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

20. #### def ^-^[B1, B2 >: A, C](f: (B1, B2) ⇒ C): Rule[In, Out, (B1) ⇒ C, X]

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

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

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

24. #### def ^~^[B1, B2, B >: A, C](f: (B1, B2) ⇒ C)(implicit arg0: (B) ⇒ ~[B1, B2]): Rule[In, Out, C, X]

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

25. #### def ^~~^[B1, B2, B3, B >: A, C](f: (B1, B2, B3) ⇒ C)(implicit arg0: (B) ⇒ ~[~[B1, B2], B3]): Rule[In, Out, C, X]

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

26. #### def ^~~~^[B1, B2, B3, B4, B >: A, C](f: (B1, B2, B3, B4) ⇒ C)(implicit arg0: (B) ⇒ ~[~[~[B1, B2], B3], B4]): Rule[In, Out, C, X]

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

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

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

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

30. #### def andThen[A](g: (Result[Out, A, X]) ⇒ A): (In) ⇒ A

Definition Classes
Function1
Annotations
@unspecialized()

32. #### final def asInstanceOf[T0]: T0

Definition Classes
Any
33. #### def clone(): AnyRef

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws()
34. #### def compose[A](g: (A) ⇒ In): (A) ⇒ Result[Out, A, X]

Definition Classes
Function1
Annotations
@unspecialized()
35. #### def ensuring(cond: (Rule[In, Out, A, X]) ⇒ Boolean, msg: ⇒ Any): Rule[In, Out, A, X]

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to Ensuring[Rule[In, Out, A, X]] performed by method any2Ensuring in scala.Predef.
Definition Classes
Ensuring
36. #### def ensuring(cond: (Rule[In, Out, A, X]) ⇒ Boolean): Rule[In, Out, A, X]

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to Ensuring[Rule[In, Out, A, X]] performed by method any2Ensuring in scala.Predef.
Definition Classes
Ensuring
37. #### def ensuring(cond: Boolean, msg: ⇒ Any): Rule[In, Out, A, X]

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to Ensuring[Rule[In, Out, A, X]] performed by method any2Ensuring in scala.Predef.
Definition Classes
Ensuring
38. #### def ensuring(cond: Boolean): Rule[In, Out, A, X]

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to Ensuring[Rule[In, Out, A, X]] performed by method any2Ensuring in scala.Predef.
Definition Classes
Ensuring
39. #### final def eq(arg0: AnyRef): Boolean

Definition Classes
AnyRef
40. #### def equals(arg0: Any): Boolean

Definition Classes
AnyRef → Any

42. #### def finalize(): Unit

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws()

44. #### def formatted(fmtstr: String): String

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to StringFormat performed by method any2stringfmt in scala.Predef.
Definition Classes
StringFormat
Annotations
@inline()
45. #### final def getClass(): Class[_]

Definition Classes
AnyRef → Any
46. #### def hashCode(): Int

Definition Classes
AnyRef → Any
47. #### final def isInstanceOf[T0]: Boolean

Definition Classes
Any

50. #### final def ne(arg0: AnyRef): Boolean

Definition Classes
AnyRef
51. #### final def notify(): Unit

Definition Classes
AnyRef
52. #### final def notifyAll(): Unit

Definition Classes
AnyRef

55. #### final def synchronized[T0](arg0: ⇒ T0): T0

Definition Classes
AnyRef
56. #### def toString(): String

Definition Classes
Function1 → AnyRef → Any
57. #### final def wait(): Unit

Definition Classes
AnyRef
Annotations
@throws()
58. #### final def wait(arg0: Long, arg1: Int): Unit

Definition Classes
AnyRef
Annotations
@throws()
59. #### final def wait(arg0: Long): Unit

Definition Classes
AnyRef
Annotations
@throws()

66. #### 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

67. #### def →[B](y: B): (Rule[In, Out, A, X], B)

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to ArrowAssoc[Rule[In, Out, A, X]] performed by method any2ArrowAssoc in scala.Predef.
Definition Classes
ArrowAssoc

1. #### val self: Any

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to StringAdd performed by method any2stringadd in scala.Predef.
This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:
`(rule: StringAdd).self`
Definition Classes
2. #### val self: Any

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to StringFormat performed by method any2stringfmt in scala.Predef.
This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:
`(rule: StringFormat).self`
Definition Classes
StringFormat

### Deprecated Value Members

1. #### def x: Rule[In, Out, A, X]

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to ArrowAssoc[Rule[In, Out, A, X]] performed by method any2ArrowAssoc in scala.Predef.
This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:
`(rule: ArrowAssoc[Rule[In, Out, A, X]]).x`
Definition Classes
ArrowAssoc
Annotations
@deprecated
Deprecated

(Since version 2.10.0) Use `leftOfArrow instead`

2. #### def x: Rule[In, Out, A, X]

Implicit information
This member is added by an implicit conversion from Rule[In, Out, A, X] to Ensuring[Rule[In, Out, A, X]] performed by method any2Ensuring in scala.Predef.
This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:
`(rule: Ensuring[Rule[In, Out, A, X]]).x`
Definition Classes
Ensuring
Annotations
@deprecated
Deprecated

(Since version 2.10.0) Use `resultOfEnsuring instead`