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]
Source
OneAnd.scala
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[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  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[java.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
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped