An extractor returns: F1, F2, ..., Fi, opt[Seq[E] or E*]
A case matches: P1, P2, ..., Pj, opt[Seq[E]]
Put together: P1/F1, P2/F2, ... Pi/Fi, Pi+1/E, Pi+2/E, ... Pj/E, opt[Seq[E]]
Here Pm/Fi is the last pattern to match the fixed arity section.
productArity: the value of i, i.e. the number of non-sequence types in the extractor
nonStarArity: the value of j, i.e. the number of non-star patterns in the case definition
elementArity: j - i, i.e. the number of non-star patterns which must match sequence elements
starArity: 1 or 0 based on whether there is a star (sequence-absorbing) pattern
totalArity: nonStarArity + starArity, i.e. the number of patterns in the case definition
Note that productArity is a function only of the extractor, and
nonStar/star/totalArity are all functions of the patterns. The key
value for aligning and typing the patterns is elementArity, as it
is derived from both sets of information.
final case classAligned(patterns: Patterns, extractor: Extractor) extends Product with Serializable
If elementArity is.
final case classExtractor(whole: Type, fixed: List[Type], repeated: Repeated) extends Product with Serializable
An 'extractor' can be a case class or an unapply or unapplySeq method.
final case classPatterns(fixed: List[Pattern], star: Pattern) extends Product with Serializable
sealed case classRepeated(sequenceType: Type, elementType: Type, repeatedType: Type) extends Product with Serializable
It's not optimal that we're carrying both sequence and repeated
type here, but the implementation requires more unraveling before
it can be avoided.
final case classTypedPat(pat: Pattern, tpe: Type) extends Product with Serializable
Abstract Value Members
abstract defNoPattern: Pattern
You'll note we're not inside the cake.
You'll note we're not inside the cake. "Pattern" and "Type" are
arbitrary types here, and NoPattern and NoType arbitrary values.
abstract defNoType: Type
Concrete Value Members
final def!=(arg0: Any): Boolean
Definition Classes
AnyRef → Any
final def##(): Int
Definition Classes
AnyRef → Any
def+(other: String): String
Implicit information
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
any2stringadd[PatternExpander[Pattern, Type]] performed by method any2stringadd in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
ArrowAssoc[PatternExpander[Pattern, Type]] performed by method ArrowAssoc in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
Ensuring[PatternExpander[Pattern, Type]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
Ensuring[PatternExpander[Pattern, Type]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
Ensuring[PatternExpander[Pattern, Type]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
Ensuring[PatternExpander[Pattern, Type]] performed by method Ensuring in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
StringFormat[PatternExpander[Pattern, Type]] performed by method StringFormat in scala.Predef.
This member is added by an implicit conversion from PatternExpander[Pattern, Type] to
ArrowAssoc[PatternExpander[Pattern, Type]] performed by method ArrowAssoc in scala.Predef.
An extractor returns: F1, F2, ..., Fi, opt[Seq[E] or E*] A case matches: P1, P2, ..., Pj, opt[Seq[E]] Put together: P1/F1, P2/F2, ... Pi/Fi, Pi+1/E, Pi+2/E, ... Pj/E, opt[Seq[E]]
Here Pm/Fi is the last pattern to match the fixed arity section.
productArity: the value of i, i.e. the number of non-sequence types in the extractor nonStarArity: the value of j, i.e. the number of non-star patterns in the case definition elementArity: j - i, i.e. the number of non-star patterns which must match sequence elements starArity: 1 or 0 based on whether there is a star (sequence-absorbing) pattern totalArity: nonStarArity + starArity, i.e. the number of patterns in the case definition
Note that productArity is a function only of the extractor, and nonStar/star/totalArity are all functions of the patterns. The key value for aligning and typing the patterns is elementArity, as it is derived from both sets of information.