layout: home


cats-scalacheck Build Status Maven Central

Quick Start

cats-scalacheck is published for scala 2.12 and 2.13, and scalajs 1.0.0. If you require scalajs 0.6 and/or scala 2.11, you may use the last version of this project: 0.2.0

To use cats-scalacheck in an existing SBT project, add the following dependency to your build.sbt:

libraryDependencies += "io.chrisdavenport" %% "cats-scalacheck" % "<version>"

For use with scalajs 1.0.x:

libraryDependencies += "io.chrisdavenport" %%% "cats-scalacheck" % "<version>"

Getting Started

import org.scalacheck.{Gen, Arbitrary}
import org.scalacheck.cats.implicits._
import cats.Applicative

val apComposition: Gen[(Int, String)] = Applicative[Gen].product(
  Arbitrary.arbitrary[Int],
  Arbitrary.arbitrary[String]
)
// apComposition: Gen[(Int, String)] = org.scalacheck.Gen$$anon$5@3857788

Instances

Gen

Cogen