Packages

  • package root
    Definition Classes
    root
  • package cats

    The cats root package contains all the trait signatures of most Scala type classes.

    The cats root package contains all the trait signatures of most Scala type classes.

    Cats type classes are implemented using the approach from the Type classes as objects and implicits article.

    For each type class, cats provides three pieces: - Its signature: a trait that is polymorphic on a type parameter. Type class traits inherit from other type classes to indicate that any implementation of the lower type class (e.g. Applicative) can also serve as an instance for the higuer type class (e.g. Functor). - Type class 'instances, which are classes and objects that implement one or more type class signatures for some specific types. Type class instances for several data types from the Java or Scala standard libraries are declared in the subpackage cats.instances. - Syntax extensions, each of which provides the methods of the type class defines as extension methods (which in Scala 2 are encoded as implicit classes) for values of any type F; given that an instance of the type class for the receiver type (this) is in the implicit scope. Symtax extensions are declared in the cats.syntax package. - A set of laws, that are also generic on the type of the class, and are only defined on the operations of the type class. The purpose of these laws is to declare some algebraic relations (equations) between Scala expressions involving the operations of the type class, and test (but not verify) that implemented instances satisfy those equations. Laws are defined in the cats-laws package.

    Although most of cats type classes are declared in this package, some are declared in other packages: - type classes that operate on base types (kind *), and their implementations for standard library types, are contained in cats.kernel, which is a different SBT project. However, they are re-exported from this package. - type classes of kind F[_, _], such as cats.arrow.Profunctor" or cats.arrow.Arrow, which are relevant for Functional Reactive Programming or optics, are declared in the cats.arrow package. - Also, those type classes that abstract over (pure or impure) functional runtime effects are declared in the cats-effect library. - Some type classes for which no laws can be provided are left out of the main road, in a small and dirty alley. These are the alleycats.

    Definition Classes
    root
  • package data
    Definition Classes
    cats
  • AndThen
  • AppFunc
  • Binested
  • BinestedBifoldable
  • BinestedBitraverse
  • BinestedInstances
  • Chain
  • Cokleisli
  • Const
  • Cont
  • ContT
  • EitherK
  • EitherT
  • Func
  • IdT
  • IndexedReaderWriterStateT
  • IndexedState
  • IndexedStateT
  • Ior
  • IorT
  • Kleisli
  • KleisliFromFunctionPartiallyApplied
  • Nested
  • NonEmptyChainOps
  • NonEmptyList
  • NonEmptyMapOps
  • NonEmptySeq
  • NonEmptySetOps
  • NonEmptyVector
  • OneAnd
  • Op
  • OptionT
  • Reader
  • ReaderWriterState
  • ReaderWriterStateT
  • RepresentableStore
  • State
  • StateT
  • Store
  • Tuple2K
  • Validated
  • Writer
  • WriterT
  • ZipList
  • ZipSeq
  • ZipStream
  • ZipVector

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). 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]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OneAnd
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OneAnd(head: A, tail: F[A])

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. def ===(that: OneAnd[F, A])(implicit A: Eq[A], FA: Eq[F[A]]): Boolean

    Typesafe equality operator.

    Typesafe equality operator.

    This method is similar to == except that it only allows two OneAnd[F, A] values to be compared to each other, and uses equality provided by Eq[_] instances, rather than using the universal equality provided by .equals.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. def combine(other: OneAnd[F, A])(implicit F: Alternative[F]): OneAnd[F, A]

    Append another OneAnd to this

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def exists(p: (A) ⇒ Boolean)(implicit F: Foldable[F]): Boolean

    Check whether at least one element satisfies the predicate.

  10. def filter(f: (A) ⇒ Boolean)(implicit FA: Alternative[F], FM: Monad[F]): F[A]

    remove elements not matching the predicate

  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def find(f: (A) ⇒ Boolean)(implicit F: Foldable[F]): Option[A]

    find the first element matching the predicate, if one exists

  13. def foldLeft[B](b: B)(f: (B, A) ⇒ B)(implicit F: Foldable[F]): B

    Left-associative fold on the structure using f.

  14. def foldRight[B](lb: Eval[B])(f: (A, Eval[B]) ⇒ Eval[B])(implicit F: Foldable[F]): Eval[B]

    Right-associative fold on the structure using f.

  15. def forall(p: (A) ⇒ Boolean)(implicit F: Foldable[F]): Boolean

    Check whether all elements satisfy the predicate.

  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. val head: A
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def map[B](f: (A) ⇒ B)(implicit F: Functor[F]): OneAnd[F, B]

    Applies f to all the elements of the structure

  20. def mapK[G[_]](f: ~>[F, G]): OneAnd[G, A]

    Modify the context F using transformation f.

  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def reduceLeft(f: (A, A) ⇒ A)(implicit F: Foldable[F]): A
  25. def show(implicit A: Show[A], FA: Show[F[A]]): String

    Typesafe stringification method.

    Typesafe stringification method.

    This method is similar to .toString except that it stringifies values according to Show[_] instances, rather than using the universal .toString method.

  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. val tail: F[A]
  28. def unwrap(implicit F: Alternative[F]): F[A]

    Combine the head and tail into a single F[A] value.

  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped