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

japgolly.microlibs.cats_ext.CatsUtil.scala Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package japgolly.microlibs.cats_ext

import cats.Eq
import java.time.{Duration, Instant}

object CatsUtil {

  def equalInstantWithTolerance(tolerance: Duration): Eq[Instant] =
    Eq((a, b) => {
      val d = Duration.between(b, a).abs()
      tolerance.compareTo(d) > 0
    })

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy