Packages

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

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PatOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PatOps(x: Pat[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. def %[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  4. def &(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  5. def *[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  6. def +[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  7. def ++[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2]): Pat[A2]
  8. def +:[A1, A2](elem: A1)(implicit w: Widen2[A1, A, A2]): Pat[A2]
  9. def -[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  10. def /[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumFrac[A2]): Pat[A2]
  11. def :+[A1, A2](elem: A1)(implicit w: Widen2[A, A1, A2]): Pat[A2]
  12. def <(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
  13. def <<(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  14. def <=(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
  15. 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.

  16. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  17. def >(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
  18. def >=(that: Pat[A])(implicit ord: Ord[A]): Pat[lucre.Adjunct.Ord.Boolean]
  19. def >>(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  20. def >>>(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  21. def ^(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  22. def abs(implicit num: Num[A]): Pat[A]
  23. def absDif[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  24. def acos[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  25. def ampDb[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  26. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  27. def asin[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  28. def atan[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  29. def atan2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
  30. 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) becomes Pat(Pat(1), Pat(2), Pat(3)).

  31. def bubbleMap(f: (Pat[A]) => Pat[A]): Pat[A]

    Short-hand for .bubble.map.flatten

  32. def ceil(implicit num: NumFrac[A]): Pat[A]
  33. def choose: Pat[A]

    Chooses a random single element from the input pattern.

  34. def clip2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  35. def coin(implicit num: NumDouble[A]): Pat[lucre.Adjunct.NumDouble.Boolean]
  36. def combinations(n: Pat[Int]): Pat[Pat[A]]
  37. def cos[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  38. def cosh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  39. def cpsMidi[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  40. def cpsOct[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  41. def cubed(implicit num: Num[A]): Pat[A]
  42. def dbAmp[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  43. def difSqr[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  44. def differentiate(implicit num: Num[A]): Pat[A]
  45. def distinct: Pat[A]
  46. 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)

  47. def excess[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  48. def exp[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  49. 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]
  50. 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]
  51. def floor(implicit num: NumFrac[A]): Pat[A]
  52. def fold2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  53. def frac(implicit num: NumFrac[A]): Pat[A]
  54. def gcd(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  55. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  56. def grouped(size: Pat[Int]): Pat[Pat[A]]
  57. def hold(): Pat[A]
  58. def hypot[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
  59. def hypotApx[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
  60. 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 pattern that, or -1 of no such subsequence exists.

  61. 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.

  62. def indices: Pat[Int]
  63. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  64. def lcm(that: Pat[A])(implicit num: NumInt[A]): Pat[A]
  65. 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)

  66. 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]
  67. 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]
  68. def log[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  69. def log10[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  70. def log2[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  71. def loop(n: Pat[Int] = Int.MaxValue): Pat[A]
  72. def max[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  73. def midiCps[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  74. def midiRatio[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  75. def min[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  76. def mod[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  77. def octCps[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  78. def poll(label: Pat[String] = "poll", gate: Pat[Boolean] = true): Pat[A]
  79. def pow[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: NumDouble[A2]): Pat[A2]
  80. def rand(implicit num: Num[A]): Pat[A]
  81. def rand2(implicit num: Num[A]): Pat[A]
  82. def ratioMidi[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  83. def reciprocal[B](implicit w: Widen[A, B], num: NumFrac[B]): Pat[B]
  84. def roundTo[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  85. def roundUpTo[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  86. 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.

  87. def sig_!=(that: Pat[A])(implicit eq: Eq[A]): Pat[Boolean]
  88. def sig_==(that: Pat[A])(implicit eq: Eq[A]): Pat[Boolean]
  89. def signum(implicit num: Num[A]): Pat[A]
  90. def sin[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  91. def sinh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  92. def size: Pat[Int]

    Same as length.

  93. def sliding(size: Pat[Int], step: Pat[Int]): Pat[Pat[A]]
  94. def sliding(size: Pat[Int]): Pat[Pat[A]]
  95. def sorted(implicit ord: ScalarOrd[A]): Pat[A]
  96. def splitAt(index: Pat[Int]): (Pat[A], Pat[A])

    Shorthand for calling both take and drop.

  97. def sqrDif[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  98. def sqrSum[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  99. def sqrt[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  100. def squared(implicit num: Num[A]): Pat[A]
  101. def stutter(n: Pat[Int]): Pat[A]
  102. def sum(implicit num: Num[A]): Pat[A]
  103. def sumSqr[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  104. 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).

  105. 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)

  106. def tan[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  107. def tanh[B](implicit wd: WidenToDouble[A, B]): Pat[B]
  108. def toDouble(implicit to: ToNum[A]): Pat[Double]
  109. def toInt(implicit to: ToNum[A]): Pat[Int]
  110. def toString(): String
    Definition Classes
    Any
  111. def trunc[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  112. def unary_!(implicit num: NumBool[A]): Pat[A]
  113. def unary_-(implicit num: Num[A]): Pat[A]
  114. def unary_~(implicit num: NumInt[A]): Pat[A]
  115. 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 and elem is ever read.

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

  116. 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 and elem are constants!

  117. def wrap2[A1, A2](that: Pat[A1])(implicit w: Widen2[A, A1, A2], num: Num[A2]): Pat[A2]
  118. def zip[B](that: Pat[B]): Pat[(A, B)]
  119. def |(that: Pat[A])(implicit num: NumInt[A]): Pat[A]

Inherited from AnyVal

Inherited from Any

Ungrouped