package data
 Source
 package.scala
 Alphabetic
 By Inheritance
 data
 AnyRef
 Any
 Hide All
 Show All
 Public
 All
Type Members

sealed abstract
class
AppFunc
[F[_], A, B] extends Func[F, A, B]
An implementation of Func that's specialized to Applicative.

final
case class
Cokleisli
[F[_], A, B](run: (F[A]) ⇒ B) extends Product with Serializable
Represents a function
F[A] => B
. 
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 ofFunction.const[A, B]: A => B => A

final
case class
EitherK
[F[_], G[_], A](run: Either[F[A], G[A]]) extends Product with Serializable
F
on the left andG
on the right ofscala.util.Either
.F
on the left andG
on the right ofscala.util.Either
. run
The underlying
scala.util.Either
.
 type EitherNel[+E, +A] = Either[NonEmptyList[E], A]

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 constructorF
to be combined with the failfast effect ofEither
.Transformer for
Either
, allowing the effect of an arbitrary type constructorF
to be combined with the failfast effect ofEither
.EitherT[F, A, B]
wraps a value of typeF[Either[A, B]]
. AnF[C]
can be lifted in toEitherT[F, A, C]
viaEitherT.right
, and lifted in to aEitherT[F, C, B]
viaEitherT.left
. 
sealed abstract
class
Func
[F[_], A, B] extends AnyRef
Func is a function
A => F[B]
.Func is a function
A => F[B]
. 
final
case class
IdT
[F[_], A](value: F[A]) extends Product with Serializable
IdT[F[_], A]
is the identity monad transformer. 
sealed abstract
class
Ior
[+A, +B] extends Product with Serializable
Represents a rightbiased disjunction that is either an
A
, or aB
, or both anA
and aB
.Represents a rightbiased disjunction that is either an
A
, or aB
, or both anA
and aB
.An instance of
A Ior B
is one of:A Ior B
is similar toscala.util.Either[A, B]
, except that it can represent the simultaneous presence of anA
and aB
. It is rightbiased so methods such asmap
andflatMap
operate on theB
value. Some methods, likeflatMap
, handle the presence of two Both values using aSemigroup[A]
, while other methods, like toEither, ignore theA
value in a Both.A Ior B
is isomorphic toEither[Either[A, B], (A, B)]
, but provides methods biased towardB
values, regardless of whether theB
values appear in a Right or a Both. The isomorphicscala.util.Either
form can be accessed via the unwrap method.  type IorNel[+B, +A] = Ior[NonEmptyList[B], A]

final
case class
Kleisli
[F[_], A, B](run: (A) ⇒ F[B]) extends Product with Serializable
Represents a function
A => F[B]
. 
final
case class
Nested
[F[_], G[_], A](value: F[G[A]]) extends Product with Serializable
Similar to cats.data.Tuple2K, but for nested composition.
Similar to cats.data.Tuple2K, but for nested composition.
For instance, since both
List
andOption
have aFunctor
, then so doesList[Option[_]]
. This is represented by this data type via the instantiationNested[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)

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).
 type NonEmptyStream[A] = OneAnd[Stream, A]

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 isprivate
to prevent accidental construction of an emptyNonEmptyVector
. However, due to https://issues.scalalang.org/browse/SI6601, on Scala 2.10, this may be bypassed due to a compiler bug. 
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 Stream which is guaranteed to not be empty:
type NonEmptyStream[A] = OneAnd[Stream, A]

final
case class
OptionT
[F[_], A](value: F[Option[A]]) extends Product with Serializable
OptionT[F[_], A]
is a light wrapper on anF[Option[A]]
with some convenient methods for working with this nested structure.OptionT[F[_], A]
is a light wrapper on anF[Option[A]]
with some convenient methods for working with this nested structure.It may also be said that
OptionT
is a monad transformer forOption
.For more information, see the documentation.
 type RWS[E, L, S, A] = ReaderWriterStateT[Eval, E, L, S, A]
 type RWST[F[_], E, S, L, A] = ReaderWriterStateT[F, E, S, L, A]
 type Reader[A, B] = Kleisli[Id, A, B]
 type ReaderT[F[_], A, B] = Kleisli[F, A, B]
 type ReaderWriterState[E, L, S, A] = ReaderWriterStateT[Eval, E, L, S, A]

final
class
ReaderWriterStateT
[F[_], E, L, S, A] extends Serializable
Represents a stateful computation in a context
F[_]
, over stateS
, with an initial environmentE
, an accumulated logL
and a resultA
.  type State[S, A] = StateT[Eval, S, A]

final
class
StateT
[F[_], S, A] extends Serializable
StateT[F, S, A]
is similar toKleisli[F, S, A]
in that it takes anS
argument and produces anA
value wrapped inF
.StateT[F, S, A]
is similar toKleisli[F, S, A]
in that it takes anS
argument and produces anA
value wrapped inF
. However, it also produces anS
value representing the updated state (which is wrapped in theF
context along with theA
value. 
final
case class
Tuple2K
[F[_], G[_], A](first: F[A], second: G[A]) extends Product with Serializable
Tuple2K is a product to two independent functor values.
Tuple2K is a product to two independent functor values.
 sealed abstract class Validated [+E, +A] extends Product with Serializable
 type ValidatedNel[+E, +A] = Validated[NonEmptyList[E], A]
 type Writer[L, V] = WriterT[Id, L, V]
 final case class WriterT [F[_], L, V](run: F[(L, V)]) extends Product with Serializable
Value Members
 def NonEmptyStream[A](head: A, tail: A*): NonEmptyStream[A]
 def NonEmptyStream[A](head: A, tail: Stream[A] = Stream.empty): NonEmptyStream[A]
 val RWS: ReaderWriterState.type
 val RWST: ReaderWriterStateT.type
 val ReaderT: Kleisli.type
 object AppFunc extends AppFuncInstances
 object Cokleisli extends CokleisliInstances with Serializable
 object Const extends ConstInstances with Serializable
 object EitherK extends EitherKInstances with Serializable
 object EitherT extends EitherTInstances with Serializable
 object Func extends FuncInstances
 object IdT extends IdTInstances with Serializable
 object Ior extends IorInstances with IorFunctions with Serializable
 object Kleisli extends KleisliInstances with KleisliFunctions with Serializable
 object Nested extends NestedInstances with Serializable
 object NonEmptyList extends NonEmptyListInstances with Serializable
 object NonEmptyVector extends NonEmptyVectorInstances
 object OneAnd extends OneAndInstances with Serializable
 object OptionT extends OptionTInstances with Serializable
 object Reader
 object ReaderWriterState extends RWSFunctions
 object ReaderWriterStateT extends RWSTInstances with Serializable
 object State extends StateFunctions
 object StateT extends StateTInstances with Serializable
 object Tuple2K extends Tuple2KInstances with Serializable
 object Validated extends ValidatedInstances with ValidatedFunctions with Serializable
 object Writer
 object WriterT extends WriterTInstances with WriterTFunctions with Serializable