Last active
February 14, 2018 07:31
-
-
Save jiminoc/ea827cfaf0bb8b07df6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalaz._ | |
import scalaz.std.list._ | |
import scalaz.syntax.monad._ | |
import scalaz.syntax.monoid._ | |
import scalaz.syntax.traverse.{ToFunctorOps => _, _} | |
class Foo[F[+_] : Monad, A, B](val execute: Foo.Request[A] => F[B], val joins: Foo.Request[A] => B => List[Foo.Request[A]])(implicit J: Foo.Join[A, B]) { | |
def bar: Foo[({type l[+a]=WriterT[F, Log[A, B], a]})#l, A, B] = { | |
type TraceW[FF[+_], +AA] = WriterT[FF, Log[A, B], AA] | |
def execute(request: Request[A]): WriterT[F, Log[A, B], B] = | |
self.execute(request).liftM[TraceW] :++>> (repr => List(request -> request.response(repr, self.joins(request)(repr)))) | |
----- REDACTED ------- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment