Help with ReaderT for older scalaz v. 7.0.5.

9 views
Skip to first unread message

Watt Poosanguansit

unread,
Jan 17, 2018, 8:23:52 PM1/17/18
to scalaz
Hi,

I am trying to use ReaderT in the code that I am working with.  I found this gist that I do experiment with:

https://gist.github.com/Fristi/3884e656cc809f8d3102

However, when I do run it with older version of Scalaz 7.0.5, which I am restricted to use at the moment.  I do get these errors:

Error:(63, 7) could not find implicit value for parameter F: scalaz.Functor[Transformers.Task]
    _ <- Result.require(y > 0, Error.CannotDivideByZero)
Error:(63, 7) not enough arguments for method map: (implicit F: scalaz.Functor[Transformers.Task])scalaz.EitherT[Transformers.Task,Transformers.Error,Int].
Unspecified value parameter F.
    _ <- Result.require(y > 0, Error.CannotDivideByZero)
Error:(68, 9) could not find implicit value for parameter F: scalaz.Monad[Transformers.Task]
    div <- Result.point(3)
Error:(28, 121) [A]scalaz.Kleisli[scala.concurrent.Future,Transformers.Env,A] takes one type parameter, expected: two
    implicit def taskMonad(implicit M: Monad[Future]): MonadReader[({type R[A] = ReaderT[Future, Transformers.Env, A]})#R, Env] =
Error:(29, 7) not found: value ReaderT
      ReaderT.kleisliMonadReader[Future, Env]
Error:(31, 76) not found: type DisjunctionT
    implicit def resultMonad(implicit M: Monad[Task]): Monad[({type D[A] = DisjunctionT[Transformers.Task, Transformers.Error, A]})#D] =
Error:(32, 27) kinds of the type arguments (Transformers.Task,Transformers.Error) do not conform to the expected kinds of the type parameters (type F,type L).
Transformers.Task's type parameters do not match type F's expected parameters:
type R is invariant, but type _ is declared covariant
      EitherT.eitherTMonad[Task, Error]
Error:(36, 14) kinds of the type arguments (Transformers.Task,Transformers.Error,R) do not conform to the expected kinds of the type parameters (type F,type A,type B).
Transformers.Task's type parameters do not match type F's expected parameters:
type R is invariant, but type _ is declared covariant
      EitherT[Task, Error, R](Kleisli(f => statement(f)))
Error:(42, 12) diverging implicit expansion for type scalaz.Monad[Transformers.Result]
starting with method eitherTMonad in trait EitherTInstances0
      Monad[Result].point(e)

Appreciate any help in any pointer to the code that is working with v. 7.0.5 or any pointer to fixing the code in the gist.  Thanks for your help.
Reply all
Reply to author
Forward
0 new messages