Skip to content

Commit

Permalink
prepare to release version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bpholt committed Nov 15, 2022
1 parent eb72a71 commit d303f6e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
8 changes: 1 addition & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ThisBuild / developers := List(
)
ThisBuild / startYear := Option(2021)
ThisBuild / tlSonatypeUseLegacyHost := true
ThisBuild / tlBaseVersion := "0.1"
ThisBuild / tlBaseVersion := "1.0"
ThisBuild / githubWorkflowScalaVersions := Seq("2.13", "2.12")
ThisBuild / tlCiReleaseBranches := Seq("main")

Expand All @@ -33,12 +33,6 @@ lazy val scala2CompilerPlugins: Seq[ModuleID] = Seq(
compilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full)
)

def dedupKindProjectorOptions(opts: Seq[String]): Seq[String] =
if (opts.count(_.contains("-Ykind-projector")) > 1) opts.filterNot(_ == "-Ykind-projector") else opts

lazy val moduleBase =
Def.setting((Compile / scalaSource).value.getParentFile)

lazy val `async-utils-core` = crossProject(JVMPlatform, JSPlatform)
.in(file("core"))
.settings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ import cats.tagless.FunctorK

trait AsyncFunctorK[F[_], G[_]] {
def asyncMapK[Alg[_[_]] : FunctorK](alg: Alg[F])
(implicit AlgR: Alg[ReaderT[F, Alg[F], *]],
G: Async[G]): Alg[G]
(implicit AlgR: Alg[ReaderT[F, Alg[F], *]], G: Async[G]): Alg[G]
}

object AsyncFunctorK {

def apply[F[_], G[_]](implicit AFK: F ~~> G): F ~~> G = AFK

}

class AsyncFunctorKOps[Alg[_[_]] : FunctorK, F[_]](alg: Alg[F]) {
def asyncMapK[G[_] : Async](implicit AlgR: Alg[ReaderT[F, Alg[F], *]],
class AsyncFunctorKOps[Alg[_[_]], F[_]](val alg: Alg[F]) extends AnyVal {
def asyncMapK[G[_] : Async](implicit
F: FunctorK[Alg],
AlgR: Alg[ReaderT[F, Alg[F], *]],
AFK: F ~~> G): Alg[G] = AsyncFunctorK[F, G].asyncMapK(alg)
}

trait ToAsyncFunctorKOps {
implicit def toAsyncFunctorKOps[Alg[_[_]] : FunctorK, F[_]](alg: Alg[F]) =
implicit def toAsyncFunctorKOps[Alg[_[_]], F[_]](alg: Alg[F]) =
new AsyncFunctorKOps[Alg, F](alg)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ object stdlib extends ToAsyncFunctorKOps {
class PartiallyAppliedProvide[F[_]](private val dummy: Boolean = true) extends AnyVal {
def apply[R](service: R)
(implicit F: Async[F]): Kleisli[Future, R, *] ~> F =
λ[Kleisli[Future, R, *] ~> F] { r =>
Async[F].fromFuture(Sync[F].delay(r(service)))
new (Kleisli[Future, R, *] ~> F) {
override def apply[A](fa: Kleisli[Future, R, A]): F[A] =
Async[F].fromFuture(Sync[F].delay(fa(service)))
}
}

0 comments on commit d303f6e

Please sign in to comment.