cats-scalacheck


License

License

MIT
Categories

Categories

Scala Languages
GroupId

GroupId

com.clovellytech
ArtifactId

ArtifactId

cats-scalacheck_2.12
Last Version

Last Version

0.2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

cats-scalacheck
cats-scalacheck
Project URL

Project URL

https://github.com/ChristopherDavenport/cats-scalacheck
Project Organization

Project Organization

com.clovellytech
Source Code Management

Source Code Management

https://github.com/ChristopherDavenport/cats-scalacheck

Download cats-scalacheck_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.clovellytech/cats-scalacheck_2.12/ -->
<dependency>
    <groupId>com.clovellytech</groupId>
    <artifactId>cats-scalacheck_2.12</artifactId>
    <version>0.2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.clovellytech/cats-scalacheck_2.12/
implementation 'com.clovellytech:cats-scalacheck_2.12:0.2.0.1'
// https://jarcasting.com/artifacts/com.clovellytech/cats-scalacheck_2.12/
implementation ("com.clovellytech:cats-scalacheck_2.12:0.2.0.1")
'com.clovellytech:cats-scalacheck_2.12:jar:0.2.0.1'
<dependency org="com.clovellytech" name="cats-scalacheck_2.12" rev="0.2.0.1">
  <artifact name="cats-scalacheck_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.clovellytech', module='cats-scalacheck_2.12', version='0.2.0.1')
)
libraryDependencies += "com.clovellytech" % "cats-scalacheck_2.12" % "0.2.0.1"
[com.clovellytech/cats-scalacheck_2.12 "0.2.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.11
org.typelevel : cats-core_2.12 jar 2.1.1
org.scalacheck : scalacheck_2.12 jar 1.14.3

test (2)

Group / Artifact Type Version
org.typelevel : cats-laws_2.12 jar 2.1.1
org.typelevel : cats-testkit-scalatest_2.12 jar 1.0.1

Project Modules

There are no modules declared in this project.

cats-scalacheck Build Status Maven Central

Inspiration Was Taken From the never published cats-check. Instances for Cats for scalacheck types. So all credit to erik-stripe and the last maintainer mdedetrich for their original work on this that helped me build this.

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._
import org.scalacheck.cats.implicits._
import cats.Applicative
import cats.implicits._

val apComposition: Gen[(Int, String)] = Applicative[Gen].product(
  Arbitrary.arbitrary[Int],
  Arbitrary.arbitrary[String]
)

Instances

Gen

  • Alternative[Gen]
  • Monad[Gen]
  • FunctorFilter[Gen]
  • Monoid[A] => Monoid[Gen[A]]
  • Semigroup[A] => Semigroup[Gen[A]]

Cogen

  • ContravariantSemigroupal[Cogen]
  • MonoidK[Cogen]

Why in org.scalacheck

This was necessary because scalacheck makes some of their instances package private that are required to roll these meaningfully.

Versions

Version
0.2.0.1