Trait/Object

cats.laws

MonadLaws

Related Docs: object MonadLaws | package laws

Permalink

trait MonadLaws[F[_]] extends ApplicativeLaws[F] with FlatMapLaws[F]

Laws that must be obeyed by any Monad.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MonadLaws
  2. FlatMapLaws
  3. ApplicativeLaws
  4. ApplyLaws
  5. SemigroupalLaws
  6. FunctorLaws
  7. InvariantLaws
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. implicit abstract def F: Monad[F]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apProductConsistent[A, B](fa: F[A], f: F[(A) ⇒ B]): IsEq[F[B]]

    Permalink
    Definition Classes
    ApplicativeLaws
  5. def applicativeComposition[A, B, C](fa: F[A], fab: F[(A) ⇒ B], fbc: F[(B) ⇒ C]): IsEq[F[C]]

    Permalink

    This law is applyComposition stated in terms of pure.

    This law is applyComposition stated in terms of pure. It is a combination of applyComposition and applicativeMap and hence not strictly necessary.

    Definition Classes
    ApplicativeLaws
  6. def applicativeHomomorphism[A, B](a: A, f: (A) ⇒ B): IsEq[F[B]]

    Permalink
    Definition Classes
    ApplicativeLaws
  7. def applicativeIdentity[A](fa: F[A]): IsEq[F[A]]

    Permalink
    Definition Classes
    ApplicativeLaws
  8. def applicativeInterchange[A, B](a: A, ff: F[(A) ⇒ B]): IsEq[F[B]]

    Permalink
    Definition Classes
    ApplicativeLaws
  9. def applicativeMap[A, B](fa: F[A], f: (A) ⇒ B): IsEq[F[B]]

    Permalink
    Definition Classes
    ApplicativeLaws
  10. def applicativeUnit[A](a: A): IsEq[F[A]]

    Permalink
    Definition Classes
    ApplicativeLaws
  11. def applyComposition[A, B, C](fa: F[A], fab: F[(A) ⇒ B], fbc: F[(B) ⇒ C]): IsEq[F[C]]

    Permalink
    Definition Classes
    ApplyLaws
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def covariantComposition[A, B, C](fa: F[A], f: (A) ⇒ B, g: (B) ⇒ C): IsEq[F[C]]

    Permalink
    Definition Classes
    FunctorLaws
  15. def covariantIdentity[A](fa: F[A]): IsEq[F[A]]

    Permalink
    Definition Classes
    FunctorLaws
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def flatMapAssociativity[A, B, C](fa: F[A], f: (A) ⇒ F[B], g: (B) ⇒ F[C]): IsEq[F[C]]

    Permalink
    Definition Classes
    FlatMapLaws
  20. def flatMapConsistentApply[A, B](fa: F[A], fab: F[(A) ⇒ B]): IsEq[F[B]]

    Permalink
    Definition Classes
    FlatMapLaws
  21. def flatMapFromTailRecMConsistency[A, B](fa: F[A], fn: (A) ⇒ F[B]): IsEq[F[B]]

    Permalink

    It is possible to implement flatMap from tailRecM and map and it should agree with the flatMap implementation.

    It is possible to implement flatMap from tailRecM and map and it should agree with the flatMap implementation.

    Definition Classes
    FlatMapLaws
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. def invariantComposition[A, B, C](fa: F[A], f1: (A) ⇒ B, f2: (B) ⇒ A, g1: (B) ⇒ C, g2: (C) ⇒ B): IsEq[F[C]]

    Permalink
    Definition Classes
    InvariantLaws
  25. def invariantIdentity[A](fa: F[A]): IsEq[F[A]]

    Permalink
    Definition Classes
    InvariantLaws
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. def kleisliAssociativity[A, B, C, D](f: (A) ⇒ F[B], g: (B) ⇒ F[C], h: (C) ⇒ F[D], a: A): IsEq[F[D]]

    Permalink

    The composition of cats.data.Kleisli arrows is associative.

    The composition of cats.data.Kleisli arrows is associative. This is analogous to flatMapAssociativity.

    Definition Classes
    FlatMapLaws
  28. def kleisliLeftIdentity[A, B](a: A, f: (A) ⇒ F[B]): IsEq[F[B]]

    Permalink

    pure is the left identity element under left-to-right composition of cats.data.Kleisli arrows.

    pure is the left identity element under left-to-right composition of cats.data.Kleisli arrows. This is analogous to monadLeftIdentity.

  29. def kleisliRightIdentity[A, B](a: A, f: (A) ⇒ F[B]): IsEq[F[B]]

    Permalink

    pure is the right identity element under left-to-right composition of cats.data.Kleisli arrows.

    pure is the right identity element under left-to-right composition of cats.data.Kleisli arrows. This is analogous to monadRightIdentity.

  30. def map2EvalConsistency[A, B, C](fa: F[A], fb: F[B], f: (A, B) ⇒ C): IsEq[F[C]]

    Permalink
    Definition Classes
    ApplyLaws
  31. def map2ProductConsistency[A, B, C](fa: F[A], fb: F[B], f: (A, B) ⇒ C): IsEq[F[C]]

    Permalink
    Definition Classes
    ApplyLaws
  32. def mapFlatMapCoherence[A, B](fa: F[A], f: (A) ⇒ B): IsEq[F[B]]

    Permalink

    Make sure that map and flatMap are consistent.

  33. def monadLeftIdentity[A, B](a: A, f: (A) ⇒ F[B]): IsEq[F[B]]

    Permalink
  34. def monadRightIdentity[A](fa: F[A]): IsEq[F[A]]

    Permalink
  35. def monoidalLeftIdentity[A](fa: F[A]): (F[(Unit, A)], F[A])

    Permalink
    Definition Classes
    ApplicativeLaws
  36. def monoidalRightIdentity[A](fa: F[A]): (F[(A, Unit)], F[A])

    Permalink
    Definition Classes
    ApplicativeLaws
  37. def mproductConsistency[A, B](fa: F[A], fb: (A) ⇒ F[B]): IsEq[F[(A, B)]]

    Permalink
    Definition Classes
    FlatMapLaws
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. def productLConsistency[A, B](fa: F[A], fb: F[B]): IsEq[F[A]]

    Permalink
    Definition Classes
    ApplyLaws
  42. def productRConsistency[A, B](fa: F[A], fb: F[B]): IsEq[F[B]]

    Permalink
    Definition Classes
    ApplyLaws
  43. def semigroupalAssociativity[A, B, C](fa: F[A], fb: F[B], fc: F[C]): (F[(A, (B, C))], F[((A, B), C)])

    Permalink
    Definition Classes
    SemigroupalLaws
  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  45. def tailRecMConsistentFlatMap[A](a: A, f: (A) ⇒ F[A]): IsEq[F[A]]

    Permalink
    Definition Classes
    FlatMapLaws
  46. lazy val tailRecMStackSafety: IsEq[F[Int]]

    Permalink
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from FlatMapLaws[F]

Inherited from ApplicativeLaws[F]

Inherited from ApplyLaws[F]

Inherited from SemigroupalLaws[F]

Inherited from FunctorLaws[F]

Inherited from InvariantLaws[F]

Inherited from AnyRef

Inherited from Any

Ungrouped