atnos-org / eff

Eff monad for cats - https://atnos-org.github.io/eff
MIT License
581 stars 78 forks source link

Fx.append is not commputative #71

Closed stephanh closed 7 years ago

stephanh commented 7 years ago

type FMP = Fx.append[MP, Fx.fx2[Error, TimedFuture]] works fine. However, if I do type FMP = Fx.append[Fx.fx2[Error, TimedFuture], MP] I get the following compiler error:

Cannot prove that org.atnos.eff.Eff[org.atnos.eff.FxAppend[org.atnos.eff.Fx1[org.atnos.eff.TimedFuture],org.atnos.eff.NoFx],scala.util.Either[Throwable,Option[A]]] =:= org.atnos.eff.Eff[org.atnos.eff.Fx.fx1[org.atnos.eff.TimedFuture],scala.util.Either[Throwable,Option[A]]].
[error]           .runAsync,
[error]            ^
stephanh commented 7 years ago

Please let me know if you need some reproducible code.

etorreborre commented 7 years ago

I need to make the definition of runAsync more generic. In the meantime you can get around this by writing

val e: Eff[FMP, Int] = ???

import org.atnos.eff.syntax.all._

e.runX.runY.runError.into[Fx1[TimedFuture]].runAsync
stephanh commented 7 years ago

I just used the version that worked, type FMP = Fx.append[MP, Fx.fx2[Error, TimedFuture]].

etorreborre commented 7 years ago

Good. Anyway I am publishing the fix in 3.0.3-20170220075508-d419505 (available in a few minutes) if you want to test it.

etorreborre commented 7 years ago

It's available now.

stephanh commented 7 years ago

It worked. :+1:

etorreborre commented 7 years ago

Yay!