This is a followup to my previous question. Looks like I still did not get it. Now I am trying to compose functions that return Writer monad.
scala> val f = {x:Int => Writer("doing " + x + ";", x + 1)} f: Int => scalaz.WriterT[scalaz.Id.Id,String,Int] = scala> Kleisli(f) >=> Kleisli(f) :16: error: no type parameters for method apply: (f: A => M[B])scalaz.Kleisli[M,A,B] in object Kleisli exist so that it can be applied to arguments (Int => scalaz.WriterT[scalaz.Id.Id,String,Int]) --- because --- argument expression's type is not compatible with formal parameter type; found : Int => scalaz.WriterT[scalaz.Id.Id,String,Int] required: ?A => ?M Kleisli(f) >=> Kleisli(f)
Why doesn't it compile ?