scala
package scala
- Alphabetic
- By Inheritance
- scala
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type ::[A] = scala.collection.immutable.::[A]
- type AbstractMethodError = java.lang.AbstractMethodError
- type AnyRef = AnyRef
- type ArrayIndexOutOfBoundsException = java.lang.ArrayIndexOutOfBoundsException
- type BigDecimal = scala.math.BigDecimal
- type BigInt = scala.math.BigInt
- type ClassCastException = java.lang.ClassCastException
- type Cloneable = java.lang.Cloneable
- trait Curried extends CurriedWithTypeParameters
A marker trait that enables curried varargs.
A marker trait that enables curried varargs.
Given a function call
f(a, b, c)
, whenf
is a subtype of Curried, it should be rewritten tof.applyBegin.applyNext(a).applyNext(b).applyNext(c).applyEnd
.Optionally, some arguments to a Curried call may be a sequence argument marked as
_*
. Given a function callf(p1, s1: _*, p2)
, when translating it to the curried form, the sequence argument will becomes afoldLeft
call.f.applyBegin .applyNext(p1) .applyNextSeq(s1) .applyNext(p2) .applyEnd
Unlike traditional repeated parameters, which restrict the sequence argument at the last position, sequence arguments in a curried call are allowed at any position.
When a Curried is invoked with some type arguments, those type arguments will be moved to the
applyBegin
method. Therefore,List[Int](1 to 3: _*)
should be translated to(1 to 3).foldLeft(List.applyBegin[Int])(_.applyNext(_)).applyEnd
.Fast list builder
class PartiallyAppliedInitializer[A](builder: collection.mutable.Builder[A, List[A]]) { def applyEnd = builder.result def applyNextSeq(seq: Seq[A]) = { builder ++= seq this } def applyNext(a: A) = { builder += a this } } object FastListInitializer extends Curried { def applyBegin[A]:PartiallyAppliedInitializer[A] = new PartiallyAppliedInitializer(List.newBuilder[A]) } FastListInitializer(0, 4) should be(List(0, 4)) FastListInitializer[Int](0, 100 to 103: _*, 1) should be(List(0, 100, 101, 102, 103, 1))
Example: - type Either[+A, +B] = scala.util.Either[A, B]
- type Equiv[T] = scala.math.Equiv[T]
- type Error = java.lang.Error
- type Exception = java.lang.Exception
- type Fractional[T] = scala.math.Fractional[T]
- type IllegalArgumentException = java.lang.IllegalArgumentException
- type IndexOutOfBoundsException = java.lang.IndexOutOfBoundsException
- type IndexedSeq[+A] = scala.collection.immutable.IndexedSeq[A]
- Annotations
- @migration
- Migration
(Changed in version 2.13.0) scala.IndexedSeq is now scala.collection.immutable.IndexedSeq instead of scala.collection.IndexedSeq
- type Integral[T] = scala.math.Integral[T]
- type InterruptedException = java.lang.InterruptedException
- type Iterable[+A] = scala.collection.Iterable[A]
- type IterableOnce[+A] = scala.collection.IterableOnce[A]
- type Iterator[+A] = scala.collection.Iterator[A]
- type LazyList[+A] = scala.collection.immutable.LazyList[A]
- type Left[+A, +B] = scala.util.Left[A, B]
- type List[+A] = scala.collection.immutable.List[A]
- type NoSuchElementException = java.util.NoSuchElementException
- type NullPointerException = java.lang.NullPointerException
- type NumberFormatException = java.lang.NumberFormatException
- type Numeric[T] = scala.math.Numeric[T]
- type Ordered[T] = scala.math.Ordered[T]
- type Ordering[T] = scala.math.Ordering[T]
- type PartialOrdering[T] = scala.math.PartialOrdering[T]
- type PartiallyOrdered[T] = scala.math.PartiallyOrdered[T]
- type Range = scala.collection.immutable.Range
- type Right[+A, +B] = scala.util.Right[A, B]
- type RuntimeException = java.lang.RuntimeException
- type Seq[+A] = scala.collection.immutable.Seq[A]
- Annotations
- @migration
- Migration
(Changed in version 2.13.0) scala.Seq is now scala.collection.immutable.Seq instead of scala.collection.Seq
- type Serializable = java.io.Serializable
- type StringBuilder = scala.collection.mutable.StringBuilder
- type StringIndexOutOfBoundsException = java.lang.StringIndexOutOfBoundsException
- type Throwable = java.lang.Throwable
- type UnsupportedOperationException = java.lang.UnsupportedOperationException
- type Vector[+A] = scala.collection.immutable.Vector[A]
Deprecated Type Members
- type BufferedIterator[+A] = scala.collection.BufferedIterator[A]
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use scala.collection.BufferedIterator instead of scala.BufferedIterator
- type Stream[+A] = scala.collection.immutable.Stream[A]
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use LazyList instead of Stream
- type Traversable[+A] = scala.collection.Iterable[A]
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use Iterable instead of Traversable
- type TraversableOnce[+A] = scala.collection.IterableOnce[A]
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use IterableOnce instead of TraversableOnce
Value Members
- val +:: scala.collection.+:.type
- val :+: scala.collection.:+.type
- val ::: scala.collection.immutable.::.type
- val AnyRef: Specializable
- val BigDecimal: scala.math.BigDecimal.type
- val BigInt: scala.math.BigInt.type
- val Either: scala.util.Either.type
- val Equiv: scala.math.Equiv.type
- val Fractional: scala.math.Fractional.type
- val IndexedSeq: scala.collection.immutable.IndexedSeq.type
- val Integral: scala.math.Integral.type
- val Iterable: scala.collection.Iterable.type
- val Iterator: scala.collection.Iterator.type
- val LazyList: scala.collection.immutable.LazyList.type
- val Left: scala.util.Left.type
- val List: scala.collection.immutable.List.type
- val Nil: scala.collection.immutable.Nil.type
- val Numeric: scala.math.Numeric.type
- val Ordered: scala.math.Ordered.type
- val Ordering: scala.math.Ordering.type
- val Range: scala.collection.immutable.Range.type
- val Right: scala.util.Right.type
- val Seq: scala.collection.immutable.Seq.type
- val StringBuilder: scala.collection.mutable.StringBuilder.type
- val Vector: scala.collection.immutable.Vector.type
Deprecated Value Members
- val Stream: scala.collection.immutable.Stream.type
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use LazyList instead of Stream
- val Traversable: scala.collection.Iterable.type
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use Iterable instead of Traversable