Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Daenyth committed Jul 14, 2021
1 parent b5a5a8f commit 6c46c70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion athema/src/main/scala/higherkindness/athema/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ import cats.Functor
import higherkindness.droste._
import higherkindness.droste.data.Fix

import scala.annotation.nowarn

object `package` {

implicit val functorExprFixed: Functor[Expr.Fixed] = new Functor[Expr.Fixed] {
def map[A, B](fa: Expr.Fixed[A])(f: A => B): Expr.Fixed[B] =
scheme.cata(mapAlgebra(f)).apply(fa)
}

@nowarn("msg=match may not be exhaustive")
private def mapAlgebra[A, B](f: A => B): Algebra[Expr[A, *], Expr.Fixed[B]] =
Algebra {
case Const(c) => Fix(Const(f(c)))
case other: Expr.Fixed[B] @unchecked => other
case _ => sys.error("impossible to reach")
}

}
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ lazy val coverage = (project in file(".coverage"))
noPublishSettings,
crossScalaVersions := Seq(ScalaV.v212, ScalaV.v213),
scalaVersion := ScalaV.v213
// scalacOptions ++= on(2, 13)("-Ytasty-reader").value
)
.settings(coverageEnabled := true)
.aggregate(coreJVM)
Expand Down Expand Up @@ -204,7 +203,9 @@ lazy val athema = module("athema", prefix = "")
) ++
Seq(
"org.scalacheck" %%% "scalacheck" % V.scalacheck
).map(_ % "test")
).map(_ % "test"),
// 'nowarn' doesn't work on scala3 yet, make warnings not fatal.
scalacOptions --= on(3)("-Xfatal-warnings").value
)

lazy val athemaJVM = athema.jvm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ trait Project[F[_], R] { self =>
Project.collect[F, R, U, B](r)(pf)

def contains(r: R, c: R)(implicit R: Eq[R], F: Foldable[F]): Boolean =
// For some reason, this is ambiguous in scala3 unless I declare it here.
Project.contains[F, R](r, c)(tc, R, F)

def foldMap[Z: Monoid](r: R)(f: R => Z)(implicit F: Foldable[F]): Z =
Expand Down

0 comments on commit 6c46c70

Please sign in to comment.