Package

fs2

util

Permalink

package util

Type classes and other utilities used by fs2.

Type Classes

This package includes a minimal set of common functional type classes -- e.g., Functor, Applicative, Monad, Traverse -- along with some extensions that are more specialized like Suspendable, Catchable, Effect, and Async.

Infix syntax is provided for all of these type classes by the fs2.util.syntax object, which is used by adding import fs2.util.syntax._. The infix syntax has no runtime cost. The type classes generally do not define many derived methods (with the exception of Async). Instead, derived methods are defined soley infix. For example, Monad does not define flatten but monad infix syntax does.

Note that these type classes are intentionally minimal. Providing a general purpose set of functional structures is not a goal of FS2.

Source
util.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. util
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait Applicative[F[_]] extends Functor[F]

    Permalink

    Applicative type class.

    Applicative type class.

    For infix syntax, including derived methods like product, import fs2.util.syntax._.

    See also

    http://strictlypositive.org/IdiomLite.pdf

  2. trait Async[F[_]] extends Effect[F]

    Permalink

    Type class which describes effects that support asynchronous evaluation.

    Type class which describes effects that support asynchronous evaluation.

    Instances of this type class are defined by providing an implementation of ref, which allocates a mutable memory cell that supports various asynchronous operations.

    For infix syntax, import fs2.util.syntax._.

    Annotations
    @implicitNotFound( ... )
  3. type Attempt[+A] = Either[Throwable, A]

    Permalink

    Alias for Either[Throwable,A].

  4. trait Catchable[F[_]] extends Monad[F]

    Permalink

    Monad which tracks exceptions thrown during evaluation.

    Monad which tracks exceptions thrown during evaluation.

    For infix syntax, import fs2.util.syntax._.

  5. sealed abstract class Catenable[+A] extends AnyRef

    Permalink

    Trivial catenable sequence.

    Trivial catenable sequence. Supports O(1) append, and (amortized) O(1) uncons, such that walking the sequence via N successive uncons steps takes O(N). Like a difference list, conversion to a Seq[A] takes linear time, regardless of how the sequence is built up.

  6. trait Effect[F[_]] extends Catchable[F] with Suspendable[F]

    Permalink

    Monad which supports catching exceptions, suspending evaluation, and (potentially asynchronous) evaluation (i.e.

    Monad which supports catching exceptions, suspending evaluation, and (potentially asynchronous) evaluation (i.e. extraction of a value).

    For infix syntax, import fs2.util.syntax._.

  7. sealed trait Free[+F[_], +A] extends AnyRef

    Permalink

    A specialized free monad which captures exceptions thrown during evaluation.

  8. trait Functor[F[_]] extends AnyRef

    Permalink

    Functor type class.

    Functor type class.

    For infix syntax, including derived methods like as, import fs2.util.syntax._.

  9. sealed trait Lub1[-F[_], -G[_], +Lub[_]] extends AnyRef

    Permalink

    Type operator that witnesses the least upper bound of type constructors F and G.

    Type operator that witnesses the least upper bound of type constructors F and G.

    Given a Lub1[F,G,Lub], forall x:

    • Lub[x] >: F[x]
    • Lub[x] >: G[x]
    • there is no L[x] for which L[x] >: F[x] and L[x] >: G[x] and L[x] <: Lub[x]
  10. trait Monad[F[_]] extends Applicative[F]

    Permalink

    Monad type class.

    Monad type class.

    For infix syntax, including derived methods like flatten, import fs2.util.syntax._.

  11. sealed trait RealSupertype[-Sub, Super] extends AnyRef

    Permalink

    Evidence that A <: B.

    Evidence that A <: B. This module provides implicit RealSupertype[Sub,Super] only if Super is not one of: Any, AnyVal, AnyRef, Product, or Serializable.

    Annotations
    @implicitNotFound( ... )
  12. trait RealType[T] extends AnyRef

    Permalink

    Evidence that T is not Any.

  13. sealed trait Sub1[-F[_], +G[_]] extends AnyRef

    Permalink

    Evidence that forall x . F[x] <: G[x]

  14. trait Suspendable[F[_]] extends Monad[F]

    Permalink

    Monad which supports capturing a deferred evaluation of a by-name F[A].

    Monad which supports capturing a deferred evaluation of a by-name F[A].

    Evaluation is suspended until a value is extracted, typically via the unsafeRunAsync method on the related Effect type class or via a type constructor specific extraction method (e.g., unsafeRunSync on Task). Side-effects that occur while evaluating a suspension are evaluated exactly once at the time of extraction.

  15. trait Traverse[F[_]] extends Functor[F]

    Permalink

    Traverse type class.

    Traverse type class.

    For infix syntax, import fs2.util.syntax._.

    For parallel traverse and sequence, see the Async type class.

    See also

    http://strictlypositive.org/IdiomLite.pdf

  16. trait UF1[-F[_], +G[_]] extends AnyRef

    Permalink

    A forall a . f a -> g a.

    A forall a . f a -> g a. Aliased as F ~> G.

  17. type ~>[-F[_], +G[_]] = UF1[F, G]

    Permalink

    Operator alias for UF1[F,G].

Value Members

  1. object Applicative

    Permalink
  2. object Async

    Permalink
  3. object Attempt

    Permalink

    Provides constructors for the Attempt alias.

  4. object Catchable

    Permalink
  5. object Catenable

    Permalink
  6. object Effect

    Permalink
  7. object Free

    Permalink
  8. object Functor

    Permalink
  9. object Lub1 extends Lub1Instances1

    Permalink
  10. object Monad

    Permalink
  11. object NonFatal

    Permalink

    Alternative to scala.util.control.NonFatal that only considers VirtualMachineErrors as fatal.

  12. object RealSupertype extends NothingSubtypesItself

    Permalink
  13. object RealType extends RealTypeInstance

    Permalink
  14. object Sub1 extends Sub1Instances0

    Permalink
  15. object Suspendable

    Permalink
  16. object Traverse

    Permalink
  17. object UF1

    Permalink
  18. object syntax

    Permalink

    Provides infix syntax for the typeclasses in the util package.

Inherited from AnyRef

Inherited from Any

Ungrouped