au.id.tmm.githubprlanguagedetection.languagedetection.model.Fraction.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of github-pr-language-detection-lib_2.13 Show documentation
Show all versions of github-pr-language-detection-lib_2.13 Show documentation
github-pr-language-detection-lib
The newest version!
package au.id.tmm.githubprlanguagedetection.languagedetection.model
import cats.syntax.invariant._
final case class Fraction(asDouble: Double) extends AnyVal
object Fraction {
implicit val ordering: Ordering[Fraction] = Ordering[Double].imap[Fraction](Fraction.apply)(_.asDouble)
implicit def orderingOps(fraction: Fraction): ordering.OrderingOps = ordering.mkOrderingOps(fraction)
}