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

japgolly.microlibs.scalaz_ext.ScalazUtil.scala Maven / Gradle / Ivy

There is a newer version: 2.6-RC6
Show newest version
package japgolly.microlibs.scalaz_ext

import java.time.{Duration, Instant}
import scalaz.Equal

object ScalazUtil {

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy