Packages

object FP

Various utilities for functional programming.

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

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 clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def indexFound(w: String, i: Int): Try[Int]

    Method to determine if the String w was found at a valid index (i).

    Method to determine if the String w was found at a valid index (i).

    w

    the String (ignored unless there's an exception).

    i

    the index found.

    returns

    Success(i) if all well, else Failure(exception).

  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. def partition[X](xys: Iterable[Try[X]]): (Iterable[Try[X]], Iterable[Try[X]])

    Method to partition an method to combine elements of Try.

    Method to partition an method to combine elements of Try.

    X

    the underlying type.

    xys

    a Seq of Try[X].

    returns

    a tuple of two Seqs of Try[X], the first one being successes, the second one being failures.

  16. def partition[X](xys: Iterator[Try[X]]): (Iterator[Try[X]], Iterator[Try[X]])

    Method to partition an Iterator.

    Method to partition an Iterator.

    X

    the underlying type.

    xys

    an Iterator of Try[X].

    returns

    a tuple of two iterators of Try[X], the first one being successes, the second one being failures.

  17. def recoverOption[X](xy: => Try[Option[X]])(f: (Throwable) => Unit): Option[X]

    Attempts to recover the value from a computation represented as a lazy Try[Option[X]].

    Attempts to recover the value from a computation represented as a lazy Try[Option[X]]. If the computation succeeds, it returns the contained Option[X]. If the computation fails with a non-fatal exception, the exception is passed to the provided recovery function, and the result is None. Fatal exceptions are rethrown.

    X

    The underlying type of the Option.

    xy

    A lazy computation resulting in a Try[Option[X]]. It is evaluated when the method is invoked.

    f

    A function to handle non-fatal exceptions encountered during evaluation of xy.

    returns

    The Option[X] value if successful, None if a non-fatal exception occurs, or the exception is rethrown if it is fatal.

  18. def resource[C](resourceName: String)(implicit arg0: ClassTag[C]): Try[URL]

    Method to yield a URL for a given resourceForClass in the classpath for C.

    Method to yield a URL for a given resourceForClass in the classpath for C.

    C

    a class of the package containing the resourceForClass.

    resourceName

    the name of the resourceForClass.

    returns

    a Try[URL].

  19. def resourceForClass(resourceName: String, clazz: Class[_] = getClass): Try[URL]

    Method to yield a Try[URL] for a resource name and a given class.

    Method to yield a Try[URL] for a resource name and a given class.

    resourceName

    the name of the resource.

    clazz

    the class, relative to which the resource can be found (defaults to the caller's class).

    returns

    a Try[URL]

  20. def sampler[X](n: Int)(implicit r: Random): (X) => Boolean

    Method to return a random sampling function.

    Method to return a random sampling function.

    X

    the underlying type of the sampler.

    n

    this is the sample factor: approximately one in every n successful results will form part of the result.

    r

    (implicit) Random source of entropy.

    returns

    an X => Boolean function which is always yields false if its input is a failure, otherwise, it chooses every nth value (approximately).

  21. def sequence[X](xos: Iterator[Option[X]]): Option[Seq[X]]

    Sequence method to combine elements of Option[X].

    Sequence method to combine elements of Option[X]. The result is defined unless all the elements are None.

    NOTE that the order of the resulting values will be the reverse of the iterator. This is for performance reasons.

    X

    the underlying type.

    xos

    an Iterable of Option[X].

    returns

    an Option of Seq[X]. NOTE: that the output collection type will be Seq, regardless of the input type

  22. def sequence[X](xos: Iterable[Option[X]]): Option[Seq[X]]

    Sequence method to combine elements of type Option[X].

    Sequence method to combine elements of type Option[X]. The result is not defined unless all/any? of the elements are defined.

    NOTE that the order of the resulting values will be the reverse of the input. This is for performance reasons.

    X

    the underlying type.

    xos

    an Iterable of Option[X].

    returns

    an Option of Seq[X]. NOTE: that the output collection type will be Seq, regardless of the input type CONSIDER using Builder

  23. def sequence[X](xys: Iterable[Try[X]]): Try[Seq[X]]

    Sequence method to combine elements of Try while retaining their original order.

    Sequence method to combine elements of Try while retaining their original order.

    X

    the underlying type

    xys

    an Iterable of Try[X]

    returns

    a Try of Seq[X] NOTE: that the output collection type will be Seq, regardless of the input type

  24. def sequence[X](xys: Iterator[Try[X]]): Try[Iterator[X]]

    Sequence method to combine elements of Try.

    Sequence method to combine elements of Try.

    CONSIDER invoking sequenceRev

    X

    the underlying type

    xys

    an Iterator of Try[X]

    returns

    a Try of Iterator[X]

  25. def sequenceForgiving[X](xys: Iterable[Try[X]]): Try[Seq[X]]

    Sequence method to combine elements of Try.

    Sequence method to combine elements of Try.

    X

    the underlying type.

    xys

    an Iterable of Try[X].

    returns

    a Try of Seq[X]. NOTE: that the output collection type will be Seq, regardless of the input type

  26. def sequenceForgivingTransform[X](xys: Iterable[Try[X]])(fSuccess: (X) => Try[Option[X]], pfFailure: PartialFunction[Throwable, Try[Option[X]]]): Try[Seq[X]]

    Sequence method to combine elements of Try.

    Sequence method to combine elements of Try.

    X

    the underlying type.

    xys

    an Iterable of Try[X].

    fSuccess

    a function of type X => Try of Option[X].

    pfFailure

    a partial function of type Throwable => Try of Option[X].

    returns

    a Try of Seq[X]. NOTE: that the output collection type will be Seq, regardless of the input type

  27. def sequenceForgivingWith[X](xys: Iterable[Try[X]])(pfFailure: PartialFunction[Throwable, Try[Option[X]]]): Try[Seq[X]]

    Sequence method to combine elements of Try.

    Sequence method to combine elements of Try.

    X

    the underlying type.

    xys

    an Iterable of Try[X].

    pfFailure

    a partial function of type Throwable => Try of Option[X].

    returns

    a Try of Seq[X]. NOTE: that the output collection type will be Seq, regardless of the input type

  28. def sequenceInc[X](xos: Iterable[Option[X]]): Option[Seq[X]]

    Sequence (inclusive) method to combine elements of type Option[X].

    Sequence (inclusive) method to combine elements of type Option[X]. The result is defined unless all the elements are None.

    NOTE that the order of the resulting values will be the reverse of the input. This is for performance reasons.

    X

    the underlying type.

    xos

    an Iterable of Option[X].

    returns

    an Option of Seq[X]. NOTE: that the output collection type will be Seq, regardless of the input type

  29. def sequenceRev[X](xys: Iterable[Try[X]]): Try[Seq[X]]

    Sequence method to combine elements of Try.

    Sequence method to combine elements of Try.

    NOTE: this method is much faster than sequence but does return the elements in their reverse order.

    X

    the underlying type

    xys

    an Iterable of Try[X]

    returns

    a Try of Seq[X] NOTE: that the output collection type will be Seq, regardless of the input type

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. def tryToOption[X](f: (Throwable) => Unit)(xy: Try[X]): Option[X]

    Method to transform a Try[X] into an Option[X].

    Method to transform a Try[X] into an Option[X]. But, unlike "toOption," a Failure can be logged.

    X

    the underlying type.

    f

    a function to process any Exception (typically a logging function).

    xy

    the input Try[X].

    returns

    an Option[X].

  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped