Package

scala

Permalink

package scala

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. scala
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type ::[A] = scala.collection.immutable.::[A]

    Permalink
  2. type AbstractMethodError = java.lang.AbstractMethodError

    Permalink
  3. type AnyRef = AnyRef

    Permalink
  4. type ArrayIndexOutOfBoundsException = java.lang.ArrayIndexOutOfBoundsException

    Permalink
  5. type BigDecimal = scala.math.BigDecimal

    Permalink
  6. type BigInt = scala.math.BigInt

    Permalink
  7. type BufferedIterator[+A] = scala.collection.BufferedIterator[A]

    Permalink
  8. type ClassCastException = java.lang.ClassCastException

    Permalink
  9. type Either[+A, +B] = scala.util.Either[A, B]

    Permalink
  10. type Equiv[T] = scala.math.Equiv[T]

    Permalink
  11. type Error = java.lang.Error

    Permalink
  12. type Exception = java.lang.Exception

    Permalink
  13. type Fractional[T] = scala.math.Fractional[T]

    Permalink
  14. type IllegalArgumentException = java.lang.IllegalArgumentException

    Permalink
  15. type IndexOutOfBoundsException = java.lang.IndexOutOfBoundsException

    Permalink
  16. type IndexedSeq[+A] = scala.collection.IndexedSeq[A]

    Permalink
  17. type Integral[T] = scala.math.Integral[T]

    Permalink
  18. type InterruptedException = java.lang.InterruptedException

    Permalink
  19. type Iterable[+A] = scala.collection.Iterable[A]

    Permalink
  20. type Iterator[+A] = scala.collection.Iterator[A]

    Permalink
  21. type Left[+A, +B] = scala.util.Left[A, B]

    Permalink
  22. type List[+A] = scala.collection.immutable.List[A]

    Permalink
  23. trait LowPriorityMbOrderingImplicits extends AnyRef

    Permalink
  24. abstract class MbArray[T] extends Serializable

    Permalink

    The scala.MbArray class is an alternative implementation of the scala.Array class that does not require a scala.reflect.ClassTag to be instantiated.

    The scala.MbArray class is an alternative implementation of the scala.Array class that does not require a scala.reflect.ClassTag to be instantiated. On the other hand, the locality and unboxing guarantees are still valid when used with the miniboxing plugin. For example:

    class C[@miniboxed T] { val mb: MbArray[T] = MbArray.empty(100) }

    If the instatiation is done outside miniboxed code or cannot be optimized, the miniboxing plugin will warn (don't forget to add the -P:minibox:warn flag to your build!) **Avoid the warnings at your own risk: You will lose the locality and unboxing guarantees!**

  25. trait MiniboxedFractional[T] extends MiniboxedNumeric[T]

    Permalink
  26. trait MiniboxedIntegral[T] extends MiniboxedNumeric[T]

    Permalink
  27. trait MiniboxedNumeric[T] extends MiniboxedOrdering[T]

    Permalink
  28. class MiniboxedOps[T] extends AnyRef

    Permalink
  29. trait MiniboxedOrdered[T] extends AnyRef

    Permalink
  30. trait MiniboxedOrdering[T] extends Serializable

    Permalink
  31. type NoSuchElementException = java.util.NoSuchElementException

    Permalink
  32. type NullPointerException = java.lang.NullPointerException

    Permalink
  33. type NumberFormatException = java.lang.NumberFormatException

    Permalink
  34. type Numeric[T] = scala.math.Numeric[T]

    Permalink
  35. type Ordered[T] = scala.math.Ordered[T]

    Permalink
  36. type Ordering[T] = scala.math.Ordering[T]

    Permalink
  37. type PartialOrdering[T] = scala.math.PartialOrdering[T]

    Permalink
  38. type PartiallyOrdered[T] = scala.math.PartiallyOrdered[T]

    Permalink
  39. type Range = scala.collection.immutable.Range

    Permalink
  40. type Right[+A, +B] = scala.util.Right[A, B]

    Permalink
  41. type RuntimeException = java.lang.RuntimeException

    Permalink
  42. type Seq[+A] = scala.collection.Seq[A]

    Permalink
  43. type Stream[+A] = scala.collection.immutable.Stream[A]

    Permalink
  44. type StringBuilder = scala.collection.mutable.StringBuilder

    Permalink
  45. type StringIndexOutOfBoundsException = java.lang.StringIndexOutOfBoundsException

    Permalink
  46. type Throwable = java.lang.Throwable

    Permalink
  47. type Traversable[+A] = scala.collection.Traversable[A]

    Permalink
  48. type TraversableOnce[+A] = scala.collection.TraversableOnce[A]

    Permalink
  49. type UnsupportedOperationException = java.lang.UnsupportedOperationException

    Permalink
  50. type Vector[+A] = scala.collection.immutable.Vector[A]

    Permalink
  51. class api extends Annotation with StaticAnnotation

    Permalink

    This annotation, used in code transformed by the miniboxing compiler plugin, will result in the function not being transformed to an optimized MiniboxedFunctionX, as would otherwise happen automatically

    This annotation, used in code transformed by the miniboxing compiler plugin, will result in the function not being transformed to an optimized MiniboxedFunctionX, as would otherwise happen automatically

    See also

    The http://scala-miniboxing.org website.

  52. class generic extends Annotation with StaticAnnotation

    Permalink

    This annotation, used in code transformed by the miniboxing compiler plugin, will result in suppressing miniboxing warnings.

    This annotation, used in code transformed by the miniboxing compiler plugin, will result in suppressing miniboxing warnings.

    See also

    The http://scala-miniboxing.org website.

  53. class miniboxed extends Annotation with StaticAnnotation

    Permalink

    This annotation, used in code transformed by the miniboxing compiler plugin, will result in a lightweight specialization that gives good speedups while keeping the bytecode size from exploding.

    This annotation, used in code transformed by the miniboxing compiler plugin, will result in a lightweight specialization that gives good speedups while keeping the bytecode size from exploding.

    See also

    The http://scala-miniboxing.org website.

Value Members

  1. val #::: scala.collection.immutable.Stream.#::.type

    Permalink
  2. val +:: scala.collection.+:.type

    Permalink
  3. val :+: scala.collection.:+.type

    Permalink
  4. val ::: scala.collection.immutable.::.type

    Permalink
  5. val AnyRef: Specializable

    Permalink
  6. val BigDecimal: scala.math.BigDecimal.type

    Permalink
  7. val BigInt: scala.math.BigInt.type

    Permalink
  8. val Either: scala.util.Either.type

    Permalink
  9. val Equiv: scala.math.Equiv.type

    Permalink
  10. val Fractional: scala.math.Fractional.type

    Permalink
  11. val IndexedSeq: scala.collection.IndexedSeq.type

    Permalink
  12. val Integral: scala.math.Integral.type

    Permalink
  13. val Iterable: scala.collection.Iterable.type

    Permalink
  14. val Iterator: scala.collection.Iterator.type

    Permalink
  15. val Left: scala.util.Left.type

    Permalink
  16. val List: scala.collection.immutable.List.type

    Permalink
  17. object MbArray extends Serializable

    Permalink
  18. object MbReflection

    Permalink

    The MiniboxingReflection object allows reflecting on the type parameters of miniboxed classes.

    The MiniboxingReflection object allows reflecting on the type parameters of miniboxed classes. For example, given class C[@miniboxed T], reflection can determine at run-time whether a type parameter is miniboxed, its instantiation and what type is used to store this value. These methods do not incur any overhead, since they are compiled away by the miniboxing plugin.

    Let's see an example:

    scala> import MbReflection._
    import MbReflection._
    
    scala> class C[@miniboxed T] {
         |   override def toString: String =
         |     s"C[T = ${reifiedType[T]}, miniboxed into a ${storageType[T]}]"
         | }
    defined class C
    
    scala> new C[Int]
    res4: C[Int] = C[T = int, miniboxed into a long]
    
    scala> new C[Unit]
    res5: C[Unit] = C[T = unit, miniboxed into a long]
    
    scala> new C[Float]
    res6: C[Float] = C[T = float, miniboxed into a double]

    Yet, it's still possible to instantiate the class in an erased context, leading to suboptimal storage. Still, the miniboxing plugin will slap you on the wrist for doing so, and reflection will tell you you're doing it wrong:

    scala> def newC[T] = new C[T]
    <console>:11: warning: The following code could benefit from miniboxing
    specialization if the type parameter T of method newC would be marked
    as "@miniboxed T" (it would be used to instantiate miniboxed type
    parameter T of class C)
           def newC[T] = new C[T]
                         ^
    newC: [T]=> C[T]
    
    scala> newC[Int]
    <console>:13: warning: The method newC would benefit from miniboxing
    type parameter T, since it is instantiated by a primitive type.
                  newC[Int]
                      ^
     res3: C[Int] = C[T = reference, miniboxed into a reference]

    Finally, there's a good use case for this, if the class is always supposed to be miniboxed:

    scala> class D[@miniboxed T] {
         |   assert(isMiniboxed[T], "Idiot!")
         | }
    define class D
    
    scala> new D[String]
    java.lang.AssertionError: assertion failed: Idiot!
      at scala.Predef$.assert(Predef.scala:165)
      ... 34 elided

    The "isMiniboxed" method is also partially evaluated away by the compiler:

    scala> def foo[@miniboxed T]: Unit = {
         |   if (isMiniboxed[T])
         |     println("foo[miniboxed]")
         |   else
         |     println("foo[reference]")
         | }
    foo: [T]=> Unit
    
    scala> foo[Byte]
    foo[miniboxed]

    In the low-level bytecode you will have:

    def foo(): Unit = println("foo[reference]")
    def foo_J(...): Unit = println("foo[miniboxed]")
    def foo_D(...): Unit = println("foo[miniboxed]")

    So there is 0 overhead in using the isMiniboxed method. Still, reifiedType and storageType are not partially evaluated and do incur a small overhead.

  19. object MiniboxedFractional extends Serializable

    Permalink
  20. object MiniboxedIntegral extends Serializable

    Permalink
  21. object MiniboxedNumeric extends Serializable

    Permalink
  22. object MiniboxedOrdered

    Permalink
  23. object MiniboxedOrdering extends LowPriorityMbOrderingImplicits with Serializable

    Permalink
  24. val Nil: scala.collection.immutable.Nil.type

    Permalink
  25. val Numeric: scala.math.Numeric.type

    Permalink
  26. val Ordered: scala.math.Ordered.type

    Permalink
  27. val Ordering: scala.math.Ordering.type

    Permalink
  28. val Range: scala.collection.immutable.Range.type

    Permalink
  29. val Right: scala.util.Right.type

    Permalink
  30. val Seq: scala.collection.Seq.type

    Permalink
  31. val Stream: scala.collection.immutable.Stream.type

    Permalink
  32. val StringBuilder: scala.collection.mutable.StringBuilder.type

    Permalink
  33. val Traversable: scala.collection.Traversable.type

    Permalink
  34. val Vector: scala.collection.immutable.Vector.type

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped