Skip to content

Commit

Permalink
smallest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Nizhnik committed Feb 11, 2020
1 parent f78f4cb commit b113cae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Publish._, Dependencies._
import com.typesafe.sbt.SbtGit.git

val libVersion = "0.6.3"
val libVersion = "0.7.0"

lazy val setMinorVersion = minorVersion := {
CrossVersion.partialVersion(scalaVersion.value) match {
Expand Down
1 change: 0 additions & 1 deletion concurrent/src/main/scala/tofu/concurrent/Agent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package tofu.concurrent
import cats.{FlatMap, Monad}
import cats.effect.concurrent.{Ref, Semaphore}
import tofu.Fire
import tofu.higherKind.{RepresentableK, derived}
import tofu.syntax.fire._
import tofu.syntax.monadic._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object RepresentableK extends RepresentableKInstanceChain[RepresentableK] {

trait RepresentableKInstanceChain[TC[u[_[_]]] >: RepresentableK[u]] {
private[this] def idKRepresentableInst[A]: RepresentableK[IdK[A]#λ] = new RepresentableK[IdK[A]#λ] {
def tabulate[F[_]](hom: RepK[IdK[A]#λ, *] ~> F): F[A] = hom(RepK.apply(x => x))
def tabulate[F[_]](hom: RepK[IdK[A]#λ, *] ~> F): F[A] = hom(RepK[IdK[A]#λ](x => x))
override def mapK[F[_], G[_]](af: F[A])(fk: F ~> G): G[A] = fk(af)
override def productK[F[_], G[_]](af: F[A], ag: G[A]): Tuple2K[F, G, A] = Tuple2K(af, ag)
override def embed[F[_]: FlatMap](ft: F[F[A]]): F[A] = ft.flatten
Expand All @@ -62,8 +62,8 @@ trait RepresentableKInstanceChain[TC[u[_[_]]] >: RepresentableK[u]] {

private[this] def readerTInstance[R, A]: RepresentableK[ReaderT[*[_], R, A]] =
new RepresentableK[ReaderT[*[_], R, A]] {
def tabulate[F[_]](hom: RepK[ReaderT[*[_], R, A], *] ~> F): ReaderT[F, R, A] = ReaderT(r => hom(RepK.mk(_.run(r)))
)
def tabulate[F[_]](hom: RepK[ReaderT[*[_], R, A], *] ~> F): ReaderT[F, R, A] =
ReaderT(r => hom(RepK[ReaderT[*[_], R, A]](_.run(r))))
override def embed[F[_]: FlatMap](ft: F[ReaderT[F, R, A]]): ReaderT[F, R, A] = ReaderT(r => ft.flatMap(_.run(r)))
override def pureK[F[_]](p: Point[F]): ReaderT[F, R, A] = ReaderT(r => p.point[A])
override val unitK: ReaderT[UnitK, R, A] = super.unitK
Expand All @@ -78,7 +78,7 @@ trait RepresentableKInstanceChain[TC[u[_[_]]] >: RepresentableK[u]] {
}

private[this] def optionTInstance[A]: RepresentableK[OptionT[*[_], A]] = new RepresentableK[OptionT[*[_], A]] {
def tabulate[F[_]](hom: RepK[OptionT[*[_], A], *] ~> F): OptionT[F, A] = OptionT(hom(RepK.mk(_.value)))
def tabulate[F[_]](hom: RepK[OptionT[*[_], A], *] ~> F): OptionT[F, A] = OptionT(hom(RepK[OptionT[*[_], A]](_.value)))

override def mapK[F[_], G[_]](af: OptionT[F, A])(fk: F ~> G): OptionT[G, A] = af.mapK(fk)
override def productK[F[_], G[_]](af: OptionT[F, A], ag: OptionT[G, A]): OptionT[Tuple2K[F, G, *], A] =
Expand All @@ -95,7 +95,7 @@ trait RepresentableKInstanceChain[TC[u[_[_]]] >: RepresentableK[u]] {
private[this] def eitherTInstance[E, A]: RepresentableK[EitherT[*[_], E, A]] =
new RepresentableK[EitherT[*[_], E, A]] {
def tabulate[F[_]](hom: RepK[EitherT[*[_], E, A], *] ~> F): EitherT[F, E, A] =
EitherT(hom(RepK.mk(_.value)))
EitherT(hom(RepK[EitherT[*[_], E, A]](_.value)))

override def mapK[F[_], G[_]](af: EitherT[F, E, A])(fk: F ~> G): EitherT[G, E, A] = af.mapK(fk)
override def productK[F[_], G[_]](af: EitherT[F, E, A], ag: EitherT[G, E, A]): EitherT[Tuple2K[F, G, *], E, A] =
Expand All @@ -113,7 +113,7 @@ trait RepresentableKInstanceChain[TC[u[_[_]]] >: RepresentableK[u]] {
private[this] def writerTInstance[W, A]: RepresentableK[WriterT[*[_], W, A]] =
new RepresentableK[WriterT[*[_], W, A]] {

def tabulate[F[_]](hom: RepK[WriterT[*[_], W, A], *] ~> F): WriterT[F, W, A] = WriterT(hom(RepK.mk(_.run)))
def tabulate[F[_]](hom: RepK[WriterT[*[_], W, A], *] ~> F): WriterT[F, W, A] = WriterT(hom(RepK[WriterT[*[_], W, A]](_.run)))

override def mapK[F[_], G[_]](af: WriterT[F, W, A])(fk: F ~> G): WriterT[G, W, A] = af.mapK(fk)
override def productK[F[_], G[_]](af: WriterT[F, W, A], ag: WriterT[G, W, A]): WriterT[Tuple2K[F, G, *], W, A] =
Expand All @@ -129,7 +129,7 @@ trait RepresentableKInstanceChain[TC[u[_[_]]] >: RepresentableK[u]] {

private[this] def iorTInstance[E, A]: RepresentableK[IorT[*[_], E, A]] = new RepresentableK[IorT[*[_], E, A]] {

def tabulate[F[_]](hom: RepK[IorT[*[_], E, A], *] ~> F): IorT[F, E, A] = IorT(hom(RepK.mk(_.value)))
def tabulate[F[_]](hom: RepK[IorT[*[_], E, A], *] ~> F): IorT[F, E, A] = IorT(hom(RepK[IorT[*[_], E, A]](_.value)))

override def mapK[F[_], G[_]](af: IorT[F, E, A])(fk: F ~> G): IorT[G, E, A] =
af.mapK(fk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.io.IOException

import cats.{Applicative, Functor, ~>}
import cats.effect.{CancelToken, Fiber}
import tofu.generate.{GenRandom, GenUUID}
import tofu.generate.GenRandom
import tofu.internal.CachedMatcher
import tofu.lift.Unlift
import tofu.optics.{Contains, Extract}
Expand Down

0 comments on commit b113cae

Please sign in to comment.