Pat

trait Pat[+A] extends Product

The main trait used to define pattern elements.

A lot of operations on Pat are defined separately in PatOps.

See also
Companion
object
trait Product
trait Equals
class Object
trait Matchable
class Any
class Constant[A]
class Empty
class Pattern[A]
class Apply[A]
class ArithmSeq[A1, A2, A]
class BinaryOp[A1, A2, A3, A]
class Bind
class Brown[A1, A2, A]
class Bubble[A]
class Cat[A1, A2, A]
class Choose[A]
class Combinations[A]
class Differentiate[A]
class Distinct[A]
class Drop[A]
class ExpExp[A1, A2, A]
class ExpLin[A1, A2, A]
class FlatMap[A1, A]
class Flatten[A]
class FoldLeft[B, A]
class Format
class Gate[A]
class GeomSeq[A1, A2, A]
class Grouped[A]
class Hold[A]
class IndexOfSlice[A1, A2]
class Indices[A]
class It[A]
class Length[A]
class LinExp[A1, A2, A]
class LinLin[A1, A2, A]
class LoopWithIndex[A]
class MapWithIndex[A1, A]
class Par
class PatMap[A1, A]
class PatSeq[A]
class Poll[A]
class Shuffle[A]
class Sliding[A]
class SortWith[A]
class Sorted[A]
class Stutter[A]
class Sum[A]
class Take[A]
class Tap[A, A1]
class Tuple2_1[A, A1]
class Tuple2_2[A1, A]
class UnaryOp[A1, A]
class Updated[A1, A]
class UpdatedAll[A1, A]
class White[A]
class Zip2[A1, A2]

Value members

Abstract methods

def expand[T <: Exec[LazyRef(...)]](implicit ctx: Context[T], tx: T): Stream[T, A]
def transform[T <: Exec[LazyRef(...)]](t: Transform)(implicit ctx: Context[T], tx: T): Pat[A]

Concrete methods

def %[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def &(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def *[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def +[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def ++[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2]): Pat[A2]
Implicitly added by patOps
def +:[A1, A2](elem: A1)(implicit w: Widen2[A1, A, A2]): Pat[A2]
Implicitly added by patOps
def -[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def /[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumFrac[A2]): Pat[A2]
Implicitly added by patOps
def :+[A1, A2](elem: A1)(implicit w: Widen2[A, A1, A2]): Pat[A2]
Implicitly added by patOps
def <(that: Pat[A])(implicit ord: Ord[A]): Pat[Boolean]
Implicitly added by patOps
def <<(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def <=(that: Pat[A])(implicit ord: Ord[A]): Pat[Boolean]
Implicitly added by patOps
def <|[B](f: Pat[A] => Pat[B]): Pat[A]
Implicitly added by patOps

"Taps" into this pattern by appending a side-effect. The returned pattern will invoke both the input stream and the stream produced from the side-effecting pattern produced by f, and then pass through the input stream's value. The side-effecting stream may end early, the compound stream keeps producing while the input stream has elements.

"Taps" into this pattern by appending a side-effect. The returned pattern will invoke both the input stream and the stream produced from the side-effecting pattern produced by f, and then pass through the input stream's value. The side-effecting stream may end early, the compound stream keeps producing while the input stream has elements.

Similar to runWith for standard Scala collections.

def >(that: Pat[A])(implicit ord: Ord[A]): Pat[Boolean]
Implicitly added by patOps
def >=(that: Pat[A])(implicit ord: Ord[A]): Pat[Boolean]
Implicitly added by patOps
def >>(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def >>>(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def ^(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def abs(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def absDif[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def acos[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def ampDb[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def apply(idx: Pat[Int]): Pat[A]
Implicitly added by patNestedOps
def asin[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def atan[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def atan2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def bubble: Pat[Pat[A]]
Implicitly added by patOps

Wraps each element in a singleton pattern. For example, Pat(1, 2, 3) becomes Pat(Pat(1), Pat(2), Pat(3)).

Wraps each element in a singleton pattern. For example, Pat(1, 2, 3) becomes Pat(Pat(1), Pat(2), Pat(3)).

def bubbleMap(f: Pat[A] => Pat[A]): Pat[A]
Implicitly added by patOps

Short-hand for .bubble.map.flatten

Short-hand for .bubble.map.flatten

def ceil(implicit num: NumFrac[A]): Pat[A]
Implicitly added by patOps
def choose: Pat[A]
Implicitly added by patOps

Chooses a random single element from the input pattern.

Chooses a random single element from the input pattern.

def clip2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def coin(implicit num: NumDouble[A]): Pat[Boolean]
Implicitly added by patOps
def combinations(n: Pat[Int]): Pat[Pat[A]]
Implicitly added by patOps
def cos[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def cosh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def cpsMidi[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def cpsOct[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def cubed(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def dbAmp[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def difSqr[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def differentiate(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def distinct: Pat[A]
Implicitly added by patOps
def drop(length: Pat[Int]): Pat[A]
Implicitly added by patOps

Drops the first length elements of the input pattern. If the length is greater than the input pattern length, the result will be empty.

Drops the first length elements of the input pattern. If the length is greater than the input pattern length, the result will be empty.

E.g. Pat(4, 5, 6).drop(2) == Pat(6)

def excess[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def exp[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def expExp[A1, A2](inLo: Pat[A], inHi: Pat[A], outLo: Pat[A1], outHi: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def expLin[A1, A2](inLo: Pat[A], inHi: Pat[A], outLo: Pat[A1], outHi: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def flatMap[B](f: Pat[A] => Pat[B]): Pat[B]
Implicitly added by patNestedOps

Similar to a monadic flatMap but with the constraint the element type must be a (nested) pattern.

Similar to a monadic flatMap but with the constraint the element type must be a (nested) pattern.

def flatten: Pat[A]
Implicitly added by patNestedOps
def floor(implicit num: NumFrac[A]): Pat[A]
Implicitly added by patOps
def fold2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def foldLeft[B](z: Pat[B])(op: (Pat[B], Pat[A]) => Pat[B]): Pat[B]
Implicitly added by patNestedOps
def frac(implicit num: NumFrac[A]): Pat[A]
Implicitly added by patOps
def gcd(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def grouped(size: Pat[Int]): Pat[Pat[A]]
Implicitly added by patOps
def head: Pat[A]
Implicitly added by patNestedOps
def hold(): Pat[A]
Implicitly added by patOps
def hypot[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def hypotApx[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def indexOfSlice[B](that: Pat[B]): Pat[Int]
Implicitly added by patOps

Finds first index where this pattern contains a given other pattern as a slice.

Finds first index where this pattern contains a given other pattern as a slice.

Value Params
that

the sequence to test

Returns

the first index such that the elements of this pattern starting at this index match the elements of pattern that, or -1 of no such subsequence exists.

def indexOfSlice[B](that: Pat[B], from: Pat[Int]): Pat[Int]
Implicitly added by patOps

Finds first index after or at a start index where this pattern contains a given other pattern as a slice.

Finds first index after or at a start index where this pattern contains a given other pattern as a slice.

Value Params
from

the start index

that

the sequence to test

Returns

the first index >= from such that the elements of this pattern starting at this index match the elements of pattern that, or -1 of no such subsequence exists.

def indices: Pat[Int]
Implicitly added by patOps
def lcm(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def length: Pat[Int]
Implicitly added by patOps

Yields the number of elements in the input pattern.

Yields the number of elements in the input pattern.

E.g. Pat(4, 5, 6).length == Pat(3)

def linExp[A1, A2](inLo: Pat[A], inHi: Pat[A], outLo: Pat[A1], outHi: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def linLin[A1, A2](inLo: Pat[A], inHi: Pat[A], outLo: Pat[A1], outHi: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumFrac[A2]): Pat[A2]
Implicitly added by patOps
def log[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def log10[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def log2[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def loop(n: Pat[Int]): Pat[A]
Implicitly added by patOps
def map[B](f: Pat[A] => Pat[B]): Pat[Pat[B]]
Implicitly added by patNestedOps

Similar to a monadic map but with the constraint the element type must be a (nested) pattern.

Similar to a monadic map but with the constraint the element type must be a (nested) pattern.

def mapWithIndex[B](f: (Pat[A], Pat[Int]) => Pat[B]): Pat[Pat[B]]
Implicitly added by patNestedOps
def max[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def midiCps[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def midiRatio[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def min[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def mod[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def octCps[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def poll(label: Pat[String], gate: Pat[Boolean]): Pat[A]
Implicitly added by patOps
def pow[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
Implicitly added by patOps
def rand(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def rand2(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def ratioMidi[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def reciprocal[B](implicit w: Widen[A, B], num: NumFrac[B]): Pat[B]
Implicitly added by patOps
def roundTo[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def roundUpTo[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def shuffle: Pat[A]
Implicitly added by patOps

Randomly changes the positions of the elements in the input pattern. Warning: the input must be finite.

Randomly changes the positions of the elements in the input pattern. Warning: the input must be finite.

def sig_!=(that: Pat[A])(implicit eq: Eq[A]): Pat[Boolean]
Implicitly added by patOps
def sig_==(that: Pat[A])(implicit eq: Eq[A]): Pat[Boolean]
Implicitly added by patOps
def signum(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def sin[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def sinh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def size: Pat[Int]
Implicitly added by patOps

Same as length.

Same as length.

def sliding(size: Pat[Int]): Pat[Pat[A]]
Implicitly added by patOps
def sliding(size: Pat[Int], step: Pat[Int]): Pat[Pat[A]]
Implicitly added by patOps
def sortWith(lt: (Pat[A], Pat[A]) => Pat[Boolean]): Pat[Pat[A]]
Implicitly added by patNestedOps
def sorted(implicit ord: ScalarOrd[A]): Pat[A]
Implicitly added by patOps
def splitAt(index: Pat[Int]): (Pat[A], Pat[A])
Implicitly added by patOps

Shorthand for calling both take and drop.

Shorthand for calling both take and drop.

def sqrDif[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def sqrSum[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def sqrt[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def squared(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def stutter(n: Pat[Int]): Pat[A]
Implicitly added by patOps
def sum(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def sumSqr[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def tail: Pat[A]
Implicitly added by patOps

Drops the first element of the pattern.

Drops the first element of the pattern.

E.g. Pat(4, 5, 6).tail == Pat(5, 6).

def take(length: Pat[Int]): Pat[A]
Implicitly added by patOps

Takes only the length first elements of the input pattern, or less if the input pattern is shorter.

Takes only the length first elements of the input pattern, or less if the input pattern is shorter.

E.g. Pat(4, 5, 6).take(2) == Pat(4, 5)

def tan[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def tanh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
Implicitly added by patOps
def toDouble(implicit to: ToNum[A]): Pat[Double]
Implicitly added by patOps
def toInt(implicit to: ToNum[A]): Pat[Int]
Implicitly added by patOps
def trunc[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def unary_!(implicit num: NumBool[A]): Pat[A]
Implicitly added by patOps
def unary_-(implicit num: Num[A]): Pat[A]
Implicitly added by patOps
def unary_~(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps
def unzip: (Pat[A], Pat[B])
Implicitly added by patTuple2Ops
def updated[B >: A](index: Pat[Int], elem: B): Pat[B]
Implicitly added by patOps

Updates a single element. In other words, only one element from index and elem is ever read.

Updates a single element. In other words, only one element from index and elem is ever read.

E.g. Pat(4, 5, 6).updated(2, 7) == Pat(4, 5, 7)

def updatedAll[B >: A](index: Pat[Int], elem: Pat[B]): Pat[B]
Implicitly added by patOps

Zips the indices with the elements, and then replaces these pairs. Eagerly expands the entire input pattern.

Zips the indices with the elements, and then replaces these pairs. Eagerly expands the entire input pattern.

Be careful that this hang if both index and elem are constants!

def wrap2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
Implicitly added by patOps
def zip[B](that: Pat[B]): Pat[(A, B)]
Implicitly added by patOps
def |(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
Implicitly added by patOps

Inherited methods

def canEqual(that: Any): Boolean
Inherited from
Equals
def productArity: Int
Inherited from
Product
def productElement(n: Int): Any
Inherited from
Product
def productElementName(n: Int): String
Inherited from
Product
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def productPrefix: String
Inherited from
Product