Package

cats

Permalink

package cats

Symbolic aliases for various types are defined here.

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

Type Members

  1. type <~[F[_], G[_]] = NaturalTransformation[G, F]

    Permalink
  2. trait Alternative[F[_]] extends Applicative[F] with MonoidK[F] with Serializable

    Permalink
  3. final class Always[A] extends Eval[A]

    Permalink

    Construct a lazy Eval[A] instance.

    Construct a lazy Eval[A] instance.

    This type can be used for "lazy" values. In some sense it is equivalent to using a Function0 value.

    This type will evaluate the computation every time the value is required. It should be avoided except when laziness is required and caching must be avoided. Generally, prefer Later.

  4. trait Applicative[F[_]] extends Apply[F] with Serializable

    Permalink

    Applicative functor.

    Applicative functor.

    Allows application of a function in an Applicative context to a value in an Applicative context

    See: The Essence of the Iterator Pattern Also: Applicative programming with effects

    Must obey the laws defined in cats.laws.ApplicativeLaws.

  5. trait ApplicativeError[F[_], E] extends Applicative[F]

    Permalink

    An applicative that also allows you to raise and or handle an error value.

    An applicative that also allows you to raise and or handle an error value.

    This type class allows one to abstract over error-handling applicatives.

  6. trait Apply[F[_]] extends Functor[F] with Cartesian[F] with ApplyArityFunctions[F] with Serializable

    Permalink

    Weaker version of Applicative[F]; has apply but not pure.

    Weaker version of Applicative[F]; has apply but not pure.

    Must obey the laws defined in cats.laws.ApplyLaws.

  7. trait ApplyArityFunctions[F[_]] extends AnyRef

    Permalink
  8. trait Bifoldable[F[_, _]] extends Serializable

    Permalink

    A type class abstracting over types that give rise to two independent cats.Foldables.

  9. trait Bimonad[F[_]] extends Monad[F] with Comonad[F] with Serializable

    Permalink
  10. trait Bitraverse[F[_, _]] extends Bifoldable[F] with Bifunctor[F]

    Permalink

    A type class abstracting over types that give rise to two independent cats.Traverses.

  11. trait Cartesian[F[_]] extends Serializable

    Permalink

    Cartesian captures the idea of composing independent effectful values.

    Cartesian captures the idea of composing independent effectful values. It is of particular interest when taken together with Functor - where Functor captures the idea of applying a unary pure function to an effectful value, calling product with map allows one to apply a function of arbitrary arity to multiple independent effectful values.

    That same idea is also manifested in the form of Apply, and indeed Apply extends both Cartesian and Functor to illustrate this.

  12. trait CartesianArityFunctions extends AnyRef

    Permalink
  13. trait CoflatMap[F[_]] extends Functor[F] with Serializable

    Permalink

    Must obey the laws defined in cats.laws.CoflatMapLaws.

  14. trait Comonad[F[_]] extends CoflatMap[F] with Serializable

    Permalink

    Must obey the laws defined in cats.laws.ComonadLaws.

  15. trait CompositeAlternative[F[_], G[_]] extends Alternative[[α]F[G[α]]] with CompositeApplicative[F, G] with CompositeMonoidK[F, G]

    Permalink
  16. trait CompositeApplicative[F[_], G[_]] extends Applicative[[α]F[G[α]]] with CompositeApply[F, G]

    Permalink
  17. trait CompositeApply[F[_], G[_]] extends Apply[[X]F[G[X]]] with Composite[F, G]

    Permalink
  18. trait CompositeBifoldable[F[_, _], G[_, _]] extends Bifoldable[[A, B]F[G[A, B], G[A, B]]]

    Permalink
  19. trait CompositeBitraverse[F[_, _], G[_, _]] extends Bitraverse[[A, B]F[G[A, B], G[A, B]]] with CompositeBifoldable[F, G]

    Permalink
  20. trait CompositeFoldable[F[_], G[_]] extends Foldable[[α]F[G[α]]]

    Permalink

    Methods that apply to 2 nested Foldable instances

  21. trait CompositeMonoidK[F[_], G[_]] extends MonoidK[[α]F[G[α]]] with CompositeSemigroupK[F, G]

    Permalink
  22. trait CompositeReducible[F[_], G[_]] extends Reducible[[α]F[G[α]]] with CompositeFoldable[F, G]

    Permalink

    This class composes two Reducible instances to provide an instance for the nested types.

    This class composes two Reducible instances to provide an instance for the nested types.

    In other words, given a Reducible[F] instance (which can reduce F[A]) and a Reducible[G] instance (which can reduce G[A] values), this class is able to reduce F[G[A]] values.

  23. trait CompositeSemigroupK[F[_], G[_]] extends SemigroupK[[α]F[G[α]]]

    Permalink
  24. type Eq[A] = cats.kernel.Eq[A]

    Permalink
  25. sealed abstract class Eval[A] extends Serializable

    Permalink

    Eval is a monad which controls evaluation.

    Eval is a monad which controls evaluation.

    This type wraps a value (or a computation that produces a value) and can produce it on command via the .value method.

    There are three basic evaluation strategies:

    • Now: evaluated immediately
    • Later: evaluated once when value is needed
    • Always: evaluated every time value is needed

    The Later and Always are both lazy strategies while Now is eager. Later and Always are distinguished from each other only by memoization: once evaluated Later will save the value to be returned immediately if it is needed again. Always will run its computation every time.

    Eval supports stack-safe lazy computation via the .map and .flatMap methods, which use an internal trampoline to avoid stack overflows. Computation done within .map and .flatMap is always done lazily, even when applied to a Now instance.

    It is not generally good style to pattern-match on Eval instances. Rather, use .map and .flatMap to chain computation, and use .value to get the result when needed. It is also not good style to create Eval instances whose computation involves calling .value on another Eval instance -- this can defeat the trampolining and lead to stack overflows.

  26. trait EvalGroup[A] extends Group[Eval[A]] with EvalMonoid[A]

    Permalink
  27. trait EvalMonoid[A] extends Monoid[Eval[A]] with EvalSemigroup[A]

    Permalink
  28. trait EvalSemigroup[A] extends Semigroup[Eval[A]]

    Permalink
  29. trait FlatMap[F[_]] extends Apply[F] with Serializable

    Permalink

    FlatMap type class gives us flatMap, which allows us to have a value in a context (F[A]) and then feed that into a function that takes a normal value and returns a value in a context (A => F[B]).

    FlatMap type class gives us flatMap, which allows us to have a value in a context (F[A]) and then feed that into a function that takes a normal value and returns a value in a context (A => F[B]).

    One motivation for separating this out from Monad is that there are situations where we can implement flatMap but not pure. For example, we can implement map or flatMap that transforms the values of Map[K, ?], but we can't implement pure (because we wouldn't know what key to use when instantiating the new Map).

    See also

    See https://github.com/typelevel/cats/issues/3 for some discussion. Must obey the laws defined in cats.laws.FlatMapLaws.

  30. trait Foldable[F[_]] extends Serializable

    Permalink

    Data structures that can be folded to a summary value.

    Data structures that can be folded to a summary value.

    In the case of a collection (such as List or Set), these methods will fold together (combine) the values contained in the collection to produce a single result. Most collection types have foldLeft methods, which will usually be used by the associated Foldable[_] instance.

    Foldable[F] is implemented in terms of two basic methods:

    • foldLeft(fa, b)(f) eagerly folds fa from left-to-right.
    • foldRight(fa, b)(f) lazily folds fa from right-to-left.

    Beyond these it provides many other useful methods related to folding over F[A] values.

    See: A tutorial on the universality and expressiveness of fold

  31. trait Functor[F[_]] extends Invariant[F] with Serializable

    Permalink

    Functor.

    Functor.

    The name is short for "covariant functor".

    Must obey the laws defined in cats.laws.FunctorLaws.

  32. type Group[A] = cats.kernel.Group[A]

    Permalink
  33. type Id[A] = A

    Permalink

    Identity, encoded as type Id[A] = A, a convenient alias to make identity instances well-kinded.

    Identity, encoded as type Id[A] = A, a convenient alias to make identity instances well-kinded.

    The identity monad can be seen as the ambient monad that encodes the effect of having no effect. It is ambient in the sense that plain pure values are values of Id.

    For instance, the cats.Functor instance for cats.Id allows us to apply a function A => B to an Id[A] and get an Id[B]. However, an Id[A] is the same as A, so all we're doing is applying a pure function of type A => B to a pure value of type A to get a pure value of type B. That is, the instance encodes pure unary function application.

  34. final class Later[A] extends Eval[A]

    Permalink

    Construct a lazy Eval[A] instance.

    Construct a lazy Eval[A] instance.

    This type should be used for most "lazy" values. In some sense it is equivalent to using a lazy val.

    When caching is not required or desired (e.g. if the value produced may be large) prefer Always. When there is no computation necessary, prefer Now.

    Once Later has been evaluated, the closure (and any values captured by the closure) will not be retained, and will be available for garbage collection.

  35. trait Monad[F[_]] extends FlatMap[F] with Applicative[F] with Serializable

    Permalink

    Monad.

    Monad.

    Allows composition of dependent effectful functions.

    See: Monads for functional programming

    Must obey the laws defined in cats.laws.MonadLaws.

  36. trait MonadCombine[F[_]] extends MonadFilter[F] with Alternative[F] with Serializable

    Permalink

    The combination of a Monad with a MonoidK

  37. trait MonadError[F[_], E] extends ApplicativeError[F, E] with Monad[F]

    Permalink

    A monad that also allows you to raise and or handle an error value.

    A monad that also allows you to raise and or handle an error value.

    This type class allows one to abstract over error-handling monads.

  38. trait MonadFilter[F[_]] extends Monad[F] with Serializable

    Permalink

    a Monad equipped with an additional method which allows us to create an "Empty" value for the Monad (for whatever "empty" makes sense for that particular monad).

    a Monad equipped with an additional method which allows us to create an "Empty" value for the Monad (for whatever "empty" makes sense for that particular monad). This is of particular interest to us since it allows us to add a filter method to a Monad, which is used when pattern matching or using guards in for comprehensions.

  39. trait MonadReader[F[_], R] extends Monad[F]

    Permalink

    A monad that has the ability to read from an environment.

  40. trait MonadState[F[_], S] extends Monad[F]

    Permalink

    A monad that can read, update, and pass along state (e.g.

    A monad that can read, update, and pass along state (e.g. StateT).

    A common use case for MonadState is for syntax, especially when dealing with large monad transformer stacks. For instance:

    val M = MonadState[StateT[List, Int, ?], Int]
    import M._
    
    for {
      g <- get
      _ <- set(g + 1)
      r <- inspect(_ * 100)
    } yield r
  41. trait MonadWriter[F[_], W] extends Monad[F]

    Permalink

    A monad that support monoidal accumulation (e.g.

    A monad that support monoidal accumulation (e.g. logging List[String])

  42. type Monoid[A] = cats.kernel.Monoid[A]

    Permalink
  43. trait MonoidK[F[_]] extends SemigroupK[F] with Serializable

    Permalink

    MonoidK is a universal monoid which operates on kinds.

    MonoidK is a universal monoid which operates on kinds.

    This type class is useful when its type parameter F[_] has a structure that can be combined for any particular type, and which also has an "empty" representation. Thus, MonoidK is like a Monoid for kinds (i.e. parameterized types).

    A MonoidK[F] can produce a Monoid[F[A]] for any type A.

    Here's how to distinguish Monoid and MonoidK:

    • Monoid[A] allows A values to be combined, and also means there is an "empty" A value that functions as an identity.
    • MonoidK[F] allows two F[A] values to be combined, for any A. It also means that for any A, there is an "empty" F[A] value. The combination operation and empty value just depend on the structure of F, but not on the structure of A.
  44. abstract class NonEmptyReducible[F[_], G[_]] extends Reducible[F]

    Permalink

    This class defines a Reducible[F] in terms of a Foldable[G] together with a split method, F[A] => (A, G[A]).

    This class defines a Reducible[F] in terms of a Foldable[G] together with a split method, F[A] => (A, G[A]).

    This class can be used on any type where the first value (A) and the "rest" of the values (G[A]) can be easily found.

  45. sealed trait NotNull[A] extends AnyRef

    Permalink

    An instance of NotNull[A] indicates that A does not have a static type of Null.

    An instance of NotNull[A] indicates that A does not have a static type of Null.

    This can be useful in preventing Null from being inferred when a type parameter is omitted.

  46. final case class Now[A](value: A) extends Eval[A] with Product with Serializable

    Permalink

    Construct an eager Eval[A] instance.

    Construct an eager Eval[A] instance.

    In some sense it is equivalent to using a val.

    This type should be used when an A value is already in hand, or when the computation to produce an A value is pure and very fast.

  47. type Order[A] = cats.kernel.Order[A]

    Permalink
  48. type PartialOrder[A] = cats.kernel.PartialOrder[A]

    Permalink
  49. trait Reducible[F[_]] extends Foldable[F] with Serializable

    Permalink

    Data structures that can be reduced to a summary value.

    Data structures that can be reduced to a summary value.

    Reducible is like a non-empty Foldable. In addition to the fold methods it provides reduce methods which do not require an initial value.

    In addition to the methods needed by Foldable, Reducible is implemented in terms of two methods:

    • reduceLeftTo(fa)(f)(g) eagerly reduces with an additional mapping function
    • reduceRightTo(fa)(f)(g) lazily reduces with an additional mapping function
  50. type Semigroup[A] = cats.kernel.Semigroup[A]

    Permalink
  51. trait SemigroupK[F[_]] extends Serializable

    Permalink

    SemigroupK is a universal semigroup which operates on kinds.

    SemigroupK is a universal semigroup which operates on kinds.

    This type class is useful when its type parameter F[_] has a structure that can be combined for any particular type. Thus, SemigroupK is like a Semigroup for kinds (i.e. parameterized types).

    A SemigroupK[F] can produce a Semigroup[F[A]] for any type A.

    Here's how to distinguish Semigroup and SemigroupK:

    • Semigroup[A] allows two A values to be combined.
    • SemigroupK[F] allows two F[A] values to be combined, for any A. The combination operation just depends on the structure of F, but not the structure of A.
  52. trait Show[T] extends Serializable

    Permalink

    A type class to provide textual representation.

    A type class to provide textual representation. It is meant to be a better "toString". Whereas toString exists for any Object, regardless of whether or not the creator of the class explicitly made a toString method, a Show instance will only exist if someone explicitly provided one.

  53. trait TransLift[MT[_[_], _]] extends AnyRef

    Permalink

    A typeclass which abstracts over the ability to lift an M[A] into a MonadTransformer

  54. trait Traverse[F[_]] extends Functor[F] with Foldable[F] with Serializable

    Permalink

    Traverse, also known as Traversable.

    Traverse, also known as Traversable.

    Traversal over a structure with an effect.

    Traversing with the cats.Id effect is equivalent to cats.Functor#map. Traversing with the cats.data.Const effect where the first type parameter has a cats.Monoid instance is equivalent to cats.Foldable#fold.

    See: The Essence of the Iterator Pattern

  55. sealed trait Trivial extends AnyRef

    Permalink

    The "Unit typeclass".

    The "Unit typeclass". The only instance of Trivial is given by Trivial.manifest, and this instance is guaranteed to be in the implicit scope. Several convenience type aliases are provided in companion object, covering a few common use cases and avoiding the need for unnecessary lambdas (e.g. if you want a trivial typeclass instance for a type constructor, you should use Trivial.PH1).

  56. trait Unapply[TC[_[_]], MA] extends Serializable

    Permalink

    A type class that is used to help guide Scala's type inference to find type class instances for types which have shapes which differ from what their type classes are looking for.

    A type class that is used to help guide Scala's type inference to find type class instances for types which have shapes which differ from what their type classes are looking for.

    For example, Functor is defined for types in the shape F[_]. Scala has no problem finding instance of Functor which match this shape, such as Functor[Option], Functor[List], etc. There is also a functor defined for some types which have the Shape F[_,_] when one of the two 'holes' is fixed. For example. there is a Functor for Map[A,?] for any A, and for Either[A,?] for any A, however the Scala compiler will not find them without some coercing.

  57. type ~>[F[_], G[_]] = NaturalTransformation[F, G]

    Permalink
  58. type = Any

    Permalink
  59. type = Nothing

    Permalink

Value Members

  1. object Alternative extends Serializable

    Permalink
  2. object Always extends Serializable

    Permalink
  3. object Applicative extends Serializable

    Permalink
  4. object ApplicativeError extends Serializable

    Permalink
  5. object Apply extends Serializable

    Permalink
  6. object Bifoldable extends Serializable

    Permalink
  7. object Bimonad extends Serializable

    Permalink
  8. object Bitraverse extends Serializable

    Permalink
  9. object Cartesian extends CartesianArityFunctions with Serializable

    Permalink
  10. object CoflatMap extends Serializable

    Permalink
  11. object Comonad extends Serializable

    Permalink
  12. val Eq: cats.kernel.Eq.type

    Permalink
  13. object Eval extends EvalInstances with Serializable

    Permalink
  14. object FlatMap extends Serializable

    Permalink
  15. object Foldable extends Serializable

    Permalink
  16. object Functor extends Serializable

    Permalink
  17. val Group: cats.kernel.Group.type

    Permalink
  18. object Later extends Serializable

    Permalink
  19. object Monad extends Serializable

    Permalink
  20. object MonadCombine extends Serializable

    Permalink
  21. object MonadError extends Serializable

    Permalink
  22. object MonadFilter extends Serializable

    Permalink
  23. object MonadReader extends Serializable

    Permalink
  24. object MonadState extends Serializable

    Permalink
  25. object MonadWriter extends Serializable

    Permalink
  26. val Monoid: cats.kernel.Monoid.type

    Permalink
  27. object MonoidK extends Serializable

    Permalink
  28. object NotNull

    Permalink
  29. val Order: cats.kernel.Order.type

    Permalink
  30. val PartialOrder: cats.kernel.PartialOrder.type

    Permalink
  31. object Reducible extends Serializable

    Permalink
  32. val Semigroup: cats.kernel.Semigroup.type

    Permalink
  33. object SemigroupK extends Serializable

    Permalink
  34. object Show extends Serializable

    Permalink
  35. object TransLift

    Permalink
  36. object Traverse extends Serializable

    Permalink
  37. object Trivial

    Permalink
  38. object Unapply extends Unapply2Instances with Serializable

    Permalink
  39. package arrow

    Permalink
  40. package data

    Permalink
  41. package functor

    Permalink
  42. implicit val idInstances: Bimonad[Id] with Traverse[Id]

    Permalink
  43. object implicits extends AllSyntax with AllInstances

    Permalink
  44. package std

    Permalink
  45. package syntax

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped