final class PatOps[A] extends AnyVal
PatOps
are operations for patterns (Pat
). Instead of having these operations directly defined
in each pattern, which is a huge list, they appear here as extension methods.
- See also
Pat
- Alphabetic
- By Inheritance
- PatOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def %[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def &(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def *[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def +[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def ++[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2]): Pat[A2]
- def +:[A1, A2](elem: A1)(implicit w: Widen2[A1, A, A2]): Pat[A2]
- def -[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def /[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumFrac[A2]): Pat[A2]
- def :+[A1, A2](elem: A1)(implicit w: Widen2[A, A1, A2]): Pat[A2]
- def <(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
- def <<(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def <=(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
- def <|[B](f: (Pat[A]) => Pat[B]): Pat[A]
"Taps" into this pattern by appending a side-effect.
"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. - final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def >(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
- def >=(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
- def >>(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def >>>(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def ^(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def abs(implicit num: Num[A]): Pat[A]
- def absDif[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def acos[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def ampDb[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asin[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def atan[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def atan2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
- def bubble: Pat[Pat[A]]
Wraps each element in a singleton pattern.
Wraps each element in a singleton pattern. For example,
Pat(1, 2, 3)
becomesPat(Pat(1), Pat(2), Pat(3))
. - def bubbleMap(f: (Pat[A]) => Pat[A]): Pat[A]
Short-hand for
.bubble.map.flatten
- def ceil(implicit num: NumFrac[A]): Pat[A]
- def choose: Pat[A]
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]
- def coin(implicit num: NumDouble[A]): Pat[lucre.Adjunct.NumDouble.Boolean]
- def combinations(n: Pat[Int]): Pat[Pat[A]]
- def cos[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def cosh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def cpsMidi[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def cpsOct[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def cubed(implicit num: Num[A]): Pat[A]
- def dbAmp[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def difSqr[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def differentiate(implicit num: Num[A]): Pat[A]
- def distinct: Pat[A]
- def drop(length: Pat[Int]): Pat[A]
Drops the first
length
elements of the input pattern.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]
- def exp[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- 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]
- 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]
- def floor(implicit num: NumFrac[A]): Pat[A]
- def fold2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def frac(implicit num: NumFrac[A]): Pat[A]
- def gcd(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def grouped(size: Pat[Int]): Pat[Pat[A]]
- def hold(): Pat[A]
- def hypot[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
- def hypotApx[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
- def indexOfSlice[B](that: Pat[B], from: Pat[Int]): Pat[Int]
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.
- that
the sequence to test
- from
the start index
- returns
the first index
>= from
such that the elements of this pattern starting at this index match the elements of patternthat
, or-1
of no such subsequence exists.
- def indexOfSlice[B](that: Pat[B]): Pat[Int]
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.
- 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 indices: Pat[Int]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lcm(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
- def length: Pat[Int]
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]
- 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]
- def log[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def log10[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def log2[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def loop(n: Pat[Int] = Int.MaxValue): Pat[A]
- def max[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def midiCps[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def midiRatio[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def min[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def mod[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def octCps[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def poll(label: Pat[String] = "poll", gate: Pat[Boolean] = true): Pat[A]
- def pow[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
- def rand(implicit num: Num[A]): Pat[A]
- def rand2(implicit num: Num[A]): Pat[A]
- def ratioMidi[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def reciprocal[B](implicit w: Widen[A, B], num: NumFrac[B]): Pat[B]
- def roundTo[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def roundUpTo[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def shuffle: Pat[A]
Randomly changes the positions of the elements in the input pattern.
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]
- def sig_==(that: Pat[A])(implicit eq: Eq[A]): Pat[Boolean]
- def signum(implicit num: Num[A]): Pat[A]
- def sin[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def sinh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def size: Pat[Int]
Same as
length
. - def sliding(size: Pat[Int], step: Pat[Int]): Pat[Pat[A]]
- def sliding(size: Pat[Int]): Pat[Pat[A]]
- def sorted(implicit ord: ScalarOrd[A]): Pat[A]
- def splitAt(index: Pat[Int]): (Pat[A], Pat[A])
Shorthand for calling both
take
anddrop
. - def sqrDif[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def sqrSum[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def sqrt[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def squared(implicit num: Num[A]): Pat[A]
- def stutter(n: Pat[Int]): Pat[A]
- def sum(implicit num: Num[A]): Pat[A]
- def sumSqr[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def tail: Pat[A]
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] = 1): Pat[A]
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]
- def tanh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
- def toDouble(implicit to: ToNum[A]): Pat[Double]
- def toInt(implicit to: ToNum[A]): Pat[Int]
- def toString(): String
- Definition Classes
- Any
- def trunc[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def unary_!(implicit num: NumBool[A]): Pat[A]
- def unary_-(implicit num: Num[A]): Pat[A]
- def unary_~(implicit num: NumInt[A]): Pat[A]
- def updated[B >: A](index: Pat[Int], elem: B): Pat[B]
Updates a single element.
Updates a single element. In other words, only one element from
index
andelem
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]
Zips the indices with the elements, and then replaces these pairs.
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
andelem
are constants! - def wrap2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
- def zip[B](that: Pat[B]): Pat[(A, B)]
- def |(that: Pat[A])(implicit num: NumInt[A]): Pat[A]