Class

io.chymyst.jc

OtherInputPattern

Related Doc: package jc

Permalink

final case class OtherInputPattern(matcher: PartialFunction[Any, Unit], vars: List[Symbol], irrefutable: Boolean) extends InputPatternType with Product with Serializable

Represents a general pattern that is neither a wildcard nor a single variable nor a constant. Examples of such patterns are a(Some(x)) and a( (x, _, 2, List(a, b)) ).

A pattern is recognized to be _irrefutable_ when it is a tuple where all places are either simple variables or wildcards. For example, a( z@(x, y, _) ) is an irrefutable pattern for a 3-tuple type. On the other hand, a( (x, _, Some(_) ) ) is not irrefutable because it fails to match a( (_, _, None) ). Another recognized case of irrefutable patterns is a single case class that extends a sealed trait.

matcher

Partial function that applies to the argument when the pattern matches.

vars

List of symbols representing the variables used in the pattern, in the left-to-right order.

irrefutable

true if the pattern will always match the argument of the correct type, false otherwise.

Linear Supertypes
Serializable, Serializable, Product, Equals, InputPatternType, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OtherInputPattern
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. InputPatternType
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OtherInputPattern(matcher: PartialFunction[Any, Unit], vars: List[Symbol], irrefutable: Boolean)

    Permalink

    matcher

    Partial function that applies to the argument when the pattern matches.

    vars

    List of symbols representing the variables used in the pattern, in the left-to-right order.

    irrefutable

    true if the pattern will always match the argument of the correct type, false otherwise.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  9. val irrefutable: Boolean

    Permalink

    true if the pattern will always match the argument of the correct type, false otherwise.

  10. val isConstantValue: Boolean

    Permalink
    Definition Classes
    InputPatternType
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. def isIrrefutable: Boolean

    Permalink

    Detect whether the input pattern is irrefutable and will always match any given value.

    Detect whether the input pattern is irrefutable and will always match any given value. An irrefutable pattern does not constrain the input value but merely puts variables on the value or on its parts.

    Examples of irrefutable patterns are a(_), a(x), and a( z@(x,y,_) ), where a(...) is a molecule with a suitable value type. Examples of refutable patterns are a(1), a(Some(x)), a( (_, None) ).

    returns

    true if the pattern is irrefutable, false otherwise.

    Definition Classes
    OtherInputPatternInputPatternType
  13. val matcher: PartialFunction[Any, Unit]

    Permalink

    Partial function that applies to the argument when the pattern matches.

  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. val vars: List[Symbol]

    Permalink

    List of symbols representing the variables used in the pattern, in the left-to-right order.

  19. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from InputPatternType

Inherited from AnyRef

Inherited from Any

Ungrouped