scala

# Function

#### object Function

A module defining utility methods for higher-order functional programming.

Version

  1.0, 29/11/2006

Linear Supertypes
AnyRef, Any
Ordering

1. Alphabetic
2. By inheritance

Inherited

1. Function
2. AnyRef
3. Any

1. Hide All
2. Show all

Learn more about member selection
Visibility

1. Public
2. All

### Value Members

1. #### final def !=(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Definition Classes
     AnyRef → Any

3. #### final def ==(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

4. #### final def asInstanceOf[T0]: T0

   Definition Classes
     Any

5. #### def chain[a](fs: Seq[(a) ⇒ a]): (a) ⇒ a

   Given a sequence of functions `f1`, .

   Given a sequence of functions `f1`, ..., `fn`, return the function `f1 andThen ... andThen fn`.

   fs

     The given sequence of functions

6. #### def clone(): AnyRef

   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )

7. #### def const[T, U](x: T)(y: U): T

   The constant function

8. #### final def eq(arg0: AnyRef): Boolean

   Definition Classes
     AnyRef

9. #### def equals(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

10. #### def finalize(): Unit

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )

11. #### final def getClass(): Class[_]

    Definition Classes
      AnyRef → Any

12. #### def hashCode(): Int

    Definition Classes
      AnyRef → Any

13. #### final def isInstanceOf[T0]: Boolean

    Definition Classes
      Any

14. #### final def ne(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

15. #### final def notify(): Unit

    Definition Classes
      AnyRef

16. #### final def notifyAll(): Unit

    Definition Classes
      AnyRef

17. #### final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
      AnyRef

18. #### def toString(): String

    Definition Classes
      AnyRef → Any

19. #### def tupled[a1, a2, a3, a4, a5, b](f: (a1, a2, a3, a4, a5) ⇒ b): ((a1, a2, a3, a4, a5)) ⇒ b

    Tupling for functions of arity 5.

    Tupling for functions of arity 5. This transforms a function of arity 5 into a unary function that takes a 5-tuple of arguments.

20. #### def tupled[a1, a2, a3, a4, b](f: (a1, a2, a3, a4) ⇒ b): ((a1, a2, a3, a4)) ⇒ b

    Tupling for functions of arity 4.

    Tupling for functions of arity 4. This transforms a function of arity 4 into a unary function that takes a 4-tuple of arguments.

21. #### def tupled[a1, a2, a3, b](f: (a1, a2, a3) ⇒ b): ((a1, a2, a3)) ⇒ b

    Tupling for functions of arity 3.

    Tupling for functions of arity 3. This transforms a function of arity 3 into a unary function that takes a triple of arguments.

22. #### def tupled[a1, a2, b](f: (a1, a2) ⇒ b): ((a1, a2)) ⇒ b

    Tupling for functions of arity 2.

    Tupling for functions of arity 2. This transforms a function of arity 2 into a unary function that takes a pair of arguments.

    Note

      These functions are slotted for deprecation, but it is on hold pending superior type inference for tupling anonymous functions.

23. #### def uncurried[a1, a2, a3, a4, a5, b](f: (a1) ⇒ (a2) ⇒ (a3) ⇒ (a4) ⇒ (a5) ⇒ b): (a1, a2, a3, a4, a5) ⇒ b

    Uncurrying for functions of arity 5.

24. #### def uncurried[a1, a2, a3, a4, b](f: (a1) ⇒ (a2) ⇒ (a3) ⇒ (a4) ⇒ b): (a1, a2, a3, a4) ⇒ b

    Uncurrying for functions of arity 4.

25. #### def uncurried[a1, a2, a3, b](f: (a1) ⇒ (a2) ⇒ (a3) ⇒ b): (a1, a2, a3) ⇒ b

    Uncurrying for functions of arity 3.

26. #### def uncurried[a1, a2, b](f: (a1) ⇒ (a2) ⇒ b): (a1, a2) ⇒ b

    Uncurrying for functions of arity 2.

    Uncurrying for functions of arity 2. This transforms a unary function returning another unary function into a function of arity 2.

27. #### def unlift[T, R](f: (T) ⇒ Option[R]): PartialFunction[T, R]

    Turns a function `A => Option[B]` into a `PartialFunction[A, B]`.

    Turns a function `A => Option[B]` into a `PartialFunction[A, B]`.

    Important note: this transformation implies the original function may be called 2 or more times on each logical invocation, because the only way to supply an implementation of `isDefinedAt` is to call the function and examine the return value. See also scala.PartialFunction, method `applyOrElse`.

    f

      a function `T => Option[R]`

    returns

      a partial function defined for those inputs where f returns `Some(_)` and undefined where `f` returns `None`.

    See also

      scala.PartialFunction, method `lift`.

28. #### def untupled[a1, a2, a3, a4, a5, b](f: ((a1, a2, a3, a4, a5)) ⇒ b): (a1, a2, a3, a4, a5) ⇒ b

    Un-tupling for functions of arity 5.

    Un-tupling for functions of arity 5. This transforms a function taking a 5-tuple of arguments into a function of arity 5 which takes each argument separately.

29. #### def untupled[a1, a2, a3, a4, b](f: ((a1, a2, a3, a4)) ⇒ b): (a1, a2, a3, a4) ⇒ b

    Un-tupling for functions of arity 4.

    Un-tupling for functions of arity 4. This transforms a function taking a 4-tuple of arguments into a function of arity 4 which takes each argument separately.

30. #### def untupled[a1, a2, a3, b](f: ((a1, a2, a3)) ⇒ b): (a1, a2, a3) ⇒ b

    Un-tupling for functions of arity 3.

    Un-tupling for functions of arity 3. This transforms a function taking a triple of arguments into a ternary function which takes each argument separately.

31. #### def untupled[a1, a2, b](f: ((a1, a2)) ⇒ b): (a1, a2) ⇒ b

    Un-tupling for functions of arity 2.

    Un-tupling for functions of arity 2. This transforms a function taking a pair of arguments into a binary function which takes each argument separately.

32. #### final def wait(): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

33. #### final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

34. #### final def wait(arg0: Long): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped