Discrete

Discrete represents discrete operations that can be performed on a type A

These operations are presented by the following functions.

An example of the discrete operation on integer values could be:

import cats._, cats.collections._

implicit val intDiscrete: Discrete[Int] = new Discrete[Int] {
  override def succ(x: Int): Int = x + 1
  override def pred(x: Int): Int = x - 1
}
// intDiscrete: Discrete[Int] = repl.MdocSession$MdocApp$$anon$1@4a3991bb