cats.tests

package cats.tests

Members list

Type members

Classlikes

case object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

Attributes

Source
BuildInfo.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
BuildInfo.type
object Helpers

Helpers provides new concrete types where we control exactly which type class instances are available.

Helpers provides new concrete types where we control exactly which type class instances are available. For example, the SL type has:

- Semilattice[SL] - Arbitrary[SL] - Eq[SL]

(All types in Helpers have Arbitrary and Eq instances.)

These are useful when a type constructor (e.g. Function0) can produce many different instances depending on which instances are available for its type parameter.

Attributes

Source
Helpers.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Helpers.type
final case class ListWrapper[A](list: List[A]) extends AnyVal

This data type exists purely for testing.

This data type exists purely for testing.

The problem this type solves is to assist in picking up type class instances that have more general constraints.

For instance, OneAnd[*, F[_]] has a Monad instance if F[_] does too. By extension, it has an Applicative instance, since Applicative is a superclass of Monad.

However, if F[_] doesn't have a Monad instance but does have an Applicative instance (e.g. Validated), you can still get an Applicative instance for OneAnd[*, F[_]]. These two instances are different however, and it is a good idea to test to make sure all "variants" of the instances are lawful.

By providing this data type, we can have implicit search pick up a specific type class instance by asking for it explicitly in a block. Note that ListWrapper has no type class instances in implicit scope, save for ones related to testing (e.g. Eq, Arbitrary, Cogen).

{
 implicit val functor: Functor[ListWrapper] = ListWrapper.functor
 checkAll(..., ...)
}

Attributes

Companion
object
Source
ListWrapper.scala
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object ListWrapper

Attributes

Companion
class
Source
ListWrapper.scala
Supertypes
class Object
trait Matchable
class Any
Self type