All Downloads are FREE. Search and download functionalities are using the official Maven repository.

monocle.std.Int.scala Maven / Gradle / Ivy

The newest version!
package monocle.std

import monocle.Prism
import monocle.internal.Bounded

import cats.instances.int._

object int extends IntOptics

trait IntOptics {
  val intToChar: Prism[Int, Char] =
    Bounded.orderingBoundedSafeCast[Int, Char](_.toChar)(_.toInt)

  val intToByte: Prism[Int, Byte] =
    Bounded.orderingBoundedSafeCast[Int, Byte](_.toByte)(_.toInt)

  val intToBoolean: Prism[Int, Boolean] =
    intToByte composePrism byte.byteToBoolean
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy