Skip to content

Commit

Permalink
build: update Scala to 3.3.1 (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyri-petrou authored Oct 2, 2023
1 parent f67037d commit cbbd01c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import mill._, define._, api.Result
import scalalib._, scalalib.scalafmt._, scalalib.publish._, scalajslib._, scalanativelib._

object versions {
val scala = "3.2.1"
val scalaJS = "1.12.0"
val scalaNative = "0.4.10"
val scala = "3.3.1"
val scalaJS = "1.13.2"
val scalaNative = "0.4.15"
}

trait BaseModule extends ScalaModule with ScalafmtModule with CiReleaseModule { outer =>
Expand Down
12 changes: 8 additions & 4 deletions cats/src/io/github/iltotore/iron/NegShift.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ trait NegShift[A]:

object NegShift:

inline given NegShift[Int] = value => value | Int.MinValue
inline given NegShift[Long] = value => value | Long.MinValue
inline given NegShift[Float] = value => if value > 0 then Float.MinValue + value else value
inline given NegShift[Double] = value => if value > 0 then Double.MinValue + value else value
inline given NegShift[Int] with
def shift(value: Int): Int = value | Int.MinValue
inline given NegShift[Long] with
def shift(value: Long): Long = value | Long.MinValue
inline given NegShift[Float] with
def shift(value: Float): Float = if value > 0 then Float.MinValue + value else value
inline given NegShift[Double] with
def shift(value: Double): Double = if value > 0 then Double.MinValue + value else value
12 changes: 8 additions & 4 deletions cats/src/io/github/iltotore/iron/PosShift.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ trait PosShift[A]:

object PosShift:

inline given PosShift[Int] = value => value & Int.MaxValue
inline given PosShift[Long] = value => value & Long.MaxValue
inline given PosShift[Float] = value => if value < 0 then Float.MaxValue - value else value
inline given PosShift[Double] = value => if value < 0 then Double.MaxValue - value else value
inline given PosShift[Int] with
def shift(value: Int): Int = value & Int.MaxValue
inline given PosShift[Long] with
def shift(value: Long): Long = value & Long.MaxValue
inline given PosShift[Float] with
def shift(value: Float): Float = if value < 0 then Float.MaxValue - value else value
inline given PosShift[Double] with
def shift(value: Double): Double = if value < 0 then Double.MaxValue - value else value

0 comments on commit cbbd01c

Please sign in to comment.