p

cats

data

package data

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

Type Members

  1. sealed abstract class AppFunc [F[_], A, B] extends Func[F, A, B]

    An implementation of Func that's specialized to Applicative.

  2. final case class Cokleisli [F[_], A, B](run: (F[A]) ⇒ B) extends Product with Serializable

    Represents a function F[A] => B.

  3. final case class Const [A, B](getConst: A) extends Product with Serializable

    Const is a phantom type, it does not contain a value of its second type parameter B Const can be seen as a type level version of Function.const[A, B]: A => B => A

  4. final case class Coproduct [F[_], G[_], A](run: Either[F[A], G[A]]) extends Product with Serializable

    F on the left and G on the right of scala.util.Either.

    F on the left and G on the right of scala.util.Either.

    run

    The underlying scala.util.Either.

  5. sealed abstract class CoproductInstances extends CoproductInstances0
  6. final case class EitherT [F[_], A, B](value: F[Either[A, B]]) extends Product with Serializable

    Transformer for Either, allowing the effect of an arbitrary type constructor F to be combined with the fail-fast effect of Either.

    Transformer for Either, allowing the effect of an arbitrary type constructor F to be combined with the fail-fast effect of Either.

    EitherT[F, A, B] wraps a value of type F[Either[A, B]]. An F[C] can be lifted in to EitherT[F, A, C] via EitherT.right, and lifted in to a EitherT[F, C, B] via EitherT.left.

  7. trait EitherTFunctions extends AnyRef
  8. sealed abstract class Func [F[_], A, B] extends AnyRef

    Func is a function A => F[B].

    Func is a function A => F[B].

    See: The Essence of the Iterator Pattern

  9. sealed trait FuncApplicative [F[_], C] extends Applicative[[α]Func[F, C, α]] with FuncApply[F, C]
  10. sealed trait FuncApply [F[_], C] extends Apply[[α]Func[F, C, α]] with FuncFunctor[F, C]
  11. sealed trait FuncContravariant [F[_], C] extends Contravariant[[α]Func[F, α, C]]
  12. sealed trait FuncFunctor [F[_], C] extends Functor[[α]Func[F, C, α]]
  13. final case class IdT [F[_], A](value: F[A]) extends Product with Serializable

    IdT[F[_], A] is the identity monad transformer.

  14. sealed abstract class Ior [+A, +B] extends Product with Serializable

    Represents a right-biased disjunction that is either an A, or a B, or both an A and a B.

    Represents a right-biased disjunction that is either an A, or a B, or both an A and a B.

    An instance of A Ior B is one of:

    A Ior B is similar to Either[A, B], except that it can represent the simultaneous presence of an A and a B. It is right-biased so methods such as map and flatMap operate on the B value. Some methods, like flatMap, handle the presence of two Both values using a Semigroup[A], while other methods, like toEither, ignore the A value in a Both.

    A Ior B is isomorphic to Either[Either[A, B], (A, B)], but provides methods biased toward B values, regardless of whether the B values appear in a Right or a Both. The isomorphic scala.util.Either form can be accessed via the unwrap method.

  15. sealed trait IorFunctions extends AnyRef
  16. final case class Kleisli [F[_], A, B](run: (A) ⇒ F[B]) extends Product with Serializable

    Represents a function A => F[B].

  17. final case class Nested [F[_], G[_], A](value: F[G[A]]) extends Product with Serializable

    Similar to cats.data.Prod, but for nested composition.

    Similar to cats.data.Prod, but for nested composition.

    For instance, since both List and Option have a Functor, then so does List[Option[_]]. This is represented by this data type via the instantiation Nested[List, Option, ?].

    scala> import cats.Functor
    scala> import cats.data.Nested
    scala> import cats.implicits._
    scala> val listOption: List[Option[Int]] = List(Some(1), None)
    scala> val f: Int => String = i => (i * 2).toString
    scala> Functor[List].map(listOption)(opt => opt.map(f))
    res0: List[Option[String]] = List(Some(2), None)
    scala> val nested: Nested[List, Option, Int] = Nested(listOption)
    scala> val result: Nested[List, Option, String] = Functor[Nested[List, Option, ?]].map(nested)(f)
    scala> result.value
    res1: List[Option[String]] = List(Some(2), None)
  18. final case class NonEmptyList [A](head: A, tail: List[A]) extends Product with Serializable

    A data type which represents a non empty list of A, with single element (head) and optional structure (tail).

  19. type NonEmptyStream[A] = OneAnd[Stream, A]
  20. final class NonEmptyVector [A] extends AnyVal

    A data type which represents a Vector guaranteed to contain at least one element.

    A data type which represents a Vector guaranteed to contain at least one element.
    Note that the constructor is private to prevent accidental construction of an empty NonEmptyVector. However, due to https://issues.scala-lang.org/browse/SI-6601, on Scala 2.10, this may be bypassed due to a compiler bug.

  21. final case class OneAnd [F[_], A](head: A, tail: F[A]) extends Product with Serializable

    A data type which represents a single element (head) and some other structure (tail).

    A data type which represents a single element (head) and some other structure (tail). As we have done in package.scala, this can be used to represent a List which is guaranteed to not be empty:

    type NonEmptyList[A] = OneAnd[List, A]
  22. final case class OptionT [F[_], A](value: F[Option[A]]) extends Product with Serializable

    OptionT[F[_], A] is a light wrapper on an F[Option[A]] with some convenient methods for working with this nested structure.

    OptionT[F[_], A] is a light wrapper on an F[Option[A]] with some convenient methods for working with this nested structure.

    It may also be said that OptionT is a monad transformer for Option.

    For more information, see the documentation.

  23. final case class Prod [F[_], G[_], A](first: F[A], second: G[A]) extends Product with Serializable

    Prod is a product to two independent functor values.

    Prod is a product to two independent functor values.

    See: The Essence of the Iterator Pattern

  24. sealed trait ProdAlternative [F[_], G[_]] extends Alternative[[α]Prod[F, G, α]] with ProdApplicative[F, G] with ProdMonoidK[F, G]
  25. sealed trait ProdApplicative [F[_], G[_]] extends Applicative[[α]Prod[F, G, α]] with ProdApply[F, G]
  26. sealed trait ProdApply [F[_], G[_]] extends Apply[[α]Prod[F, G, α]] with ProdFunctor[F, G]
  27. sealed trait ProdContravariant [F[_], G[_]] extends Contravariant[[α]Prod[F, G, α]]
  28. sealed trait ProdFoldable [F[_], G[_]] extends Foldable[[α]Prod[F, G, α]]
  29. sealed trait ProdFunctor [F[_], G[_]] extends Functor[[α]Prod[F, G, α]]
  30. sealed trait ProdMonad [F[_], G[_]] extends Monad[[α]Prod[F, G, α]] with ProdApplicative[F, G]
  31. sealed trait ProdMonadCombine [F[_], G[_]] extends MonadCombine[[α]Prod[F, G, α]] with ProdMonad[F, G] with ProdAlternative[F, G]
  32. sealed trait ProdMonoidK [F[_], G[_]] extends MonoidK[[α]Prod[F, G, α]] with ProdSemigroupK[F, G]
  33. sealed trait ProdOrder [F[_], G[_], A] extends Order[Prod[F, G, A]]
  34. sealed trait ProdSemigroupK [F[_], G[_]] extends SemigroupK[[α]Prod[F, G, α]]
  35. sealed trait ProdShow [F[_], G[_], A] extends Show[Prod[F, G, A]]
  36. sealed trait ProdTraverse [F[_], G[_]] extends Traverse[[α]Prod[F, G, α]] with ProdFoldable[F, G]
  37. type Reader[A, B] = Kleisli[Id, A, B]
  38. type ReaderT[F[_], A, B] = Kleisli[F, A, B]
  39. type State[S, A] = StateT[Eval, S, A]
  40. final class StateT [F[_], S, A] extends Serializable

    StateT[F, S, A] is similar to Kleisli[F, S, A] in that it takes an S argument and produces an A value wrapped in F.

    StateT[F, S, A] is similar to Kleisli[F, S, A] in that it takes an S argument and produces an A value wrapped in F. However, it also produces an S value representing the updated state (which is wrapped in the F context along with the A value.

  41. sealed abstract class Validated [+E, +A] extends Product with Serializable
  42. trait ValidatedFunctions extends AnyRef
  43. type ValidatedNel[E, A] = Validated[NonEmptyList[E], A]
  44. type Writer[L, V] = WriterT[Id, L, V]
  45. final case class WriterT [F[_], L, V](run: F[(L, V)]) extends Product with Serializable
  46. trait WriterTFunctions extends AnyRef

Value Members

  1. def NonEmptyStream[A](head: A, tail: A*): NonEmptyStream[A]
  2. def NonEmptyStream[A](head: A, tail: Stream[A] = Stream.empty): NonEmptyStream[A]
  3. val ReaderT: Kleisli.type
  4. object AppFunc extends AppFuncInstances
  5. object Cokleisli extends CokleisliInstances with Serializable
  6. object Const extends ConstInstances with Serializable
  7. object Coproduct extends CoproductInstances with Serializable
  8. object EitherT extends EitherTInstances with EitherTFunctions with Serializable
  9. object Func extends FuncInstances
  10. object IdT extends IdTInstances with Serializable
  11. object Ior extends IorInstances with IorFunctions with Serializable
  12. object Kleisli extends KleisliInstances with KleisliFunctions with Serializable
  13. object Nested extends NestedInstances with Serializable
  14. object NonEmptyList extends NonEmptyListInstances with Serializable
  15. object NonEmptyVector extends NonEmptyVectorInstances
  16. object OneAnd extends OneAndInstances with Serializable
  17. object OptionT extends OptionTInstances with Serializable
  18. object Prod extends ProdInstances with Serializable
  19. object Reader extends Serializable
  20. object State extends StateFunctions with Serializable
  21. object StateT extends StateTInstances with Serializable
  22. object Validated extends ValidatedInstances with ValidatedFunctions with Serializable
  23. object Writer extends Serializable
  24. object WriterT extends WriterTInstances with WriterTFunctions with Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped