defapply[W[+_], M[+_], R, O, A](f: W[A=>M[O]] =>M[R]):IndexedContsT[W, M, R, O, A] =newIndexedContsT[W, M, R, O, A] {
defapply[W[_], M[_], R, O, A](f: W[A=>M[O]] =>M[R]):IndexedContsT[W, M, R, O, A] =newIndexedContsT[W, M, R, O, A] {
defrun(wamo: W[A=>M[O]]):M[R] = f(wamo)
}
}
traitIndexedContsTFunctions {
defpoint[W[+_], M[+_], R, A](a: =>A)(implicitW:Comonad[W]):ContsT[W, M, R, A] =ContsT { k =>W.copoint(k)(a) }
defpoint[W[_], M[_], R, A](a: =>A)(implicitW:Comonad[W]):ContsT[W, M, R, A] =ContsT { k =>W.copoint(k)(a) }
defliftM[W[+_], M[+_], R, O, A](a: =>M[A])(implicitW:Comonad[W], M:Bind[M]):ContsT[W, M, R, A] =ContsT { k =>M.bind(a)(W.copoint(k)) }
defliftM[W[_], M[_], R, O, A](a: =>M[A])(implicitW:Comonad[W], M:Bind[M]):ContsT[W, M, R, A] =ContsT { k =>M.bind(a)(W.copoint(k)) }
defshift[W[+_], M[+_], I, R, J, O, A](f: (A=>IndexedContsT[W, M, I, I, O]) =>IndexedContsT[W, M, R, J, J])(implicitW:Comonad[W], WA:Applicative[W], M:Monad[M]):IndexedContsT[W, M, R, O, A] =
defshift[W[_], M[_], I, R, J, O, A](f: (A=>IndexedContsT[W, M, I, I, O]) =>IndexedContsT[W, M, R, J, J])(implicitW:Comonad[W], WA:Applicative[W], M:Monad[M]):IndexedContsT[W, M, R, O, A] =
defreset[W[+_], M[+_], R, O, A](v: IndexedContsT[W, M, A, O, O])(implicitW:Comonad[W], WA:Applicative[W], M:Monad[M]):IndexedContsT[W, M, R, R, A] =
defreset[W[_], M[_], R, O, A](v: IndexedContsT[W, M, A, O, O])(implicitW:Comonad[W], WA:Applicative[W], M:Monad[M]):IndexedContsT[W, M, R, R, A] =
IndexedContsT { k =>
M.bind(v.run_)(W.copoint(k))
}
defcallCC[W[+_], M[+_], R, O, A](f: (A=>IndexedContsT[W, M, Any, O, Nothing]) =>IndexedContsT[W, M, R, O, A])(implicitW:Comonad[W]):IndexedContsT[W, M, R, O, A] =
defcallCC[W[_], M[_], R, O, A, B](f: (A=>IndexedContsT[W, M, O, O, B]) =>IndexedContsT[W, M, R, O, A])(implicitW:Comonad[W]):IndexedContsT[W, M, R, O, A] =
IndexedContsT { k =>
(f { a =>
IndexedContsT { u =>
IndexedContsT[W, M, O, O, B] { u =>
W.copoint(k)(a)
}
}).run(k)
}
}
traitIndexedContsTInstances0 {
implicitdefIndexedContsTFunctorRight[W[+_], M[+_], R, O](implicitW0:Functor[W]):Functor[({typef[+a]=IndexedContsT[W, M, R, O, a]})#f] =newIndexedContsTFunctorRight[W, M, R, O] {
implicitdefIndexedContsTFunctorRight[W[_], M[_], R, O](implicitW0:Functor[W]):Functor[({typef[a]=IndexedContsT[W, M, R, O, a]})#f] =newIndexedContsTFunctorRight[W, M, R, O] {
implicitdefIndexedContsTFunctorLeft[W[+_], M[+_], O, A](implicitM0:Functor[M]):Functor[({typef[+r]=IndexedContsT[W, M, r, O, A]})#f] =newIndexedContsTFunctorLeft[W, M, O, A] {
implicitdefIndexedContsTFunctorLeft[W[_], M[_], O, A](implicitM0:Functor[M]):Functor[({typef[r]=IndexedContsT[W, M, r, O, A]})#f] =newIndexedContsTFunctorLeft[W, M, O, A] {
implicitvalM:Functor[M] =M0
}
implicitdefIndexedContsTContravariant[W[+_], M[+_], R, A](implicitW0:Functor[W], M0:Functor[M]):Contravariant[({typef[-o]=IndexedContsT[W, M, R, o, A]})#f] =newIndexedContsTContravariant[W, M, R, A] {
implicitdefIndexedContsTContravariant[W[_], M[_], R, A](implicitW0:Functor[W], M0:Functor[M]):Contravariant[({typef[o]=IndexedContsT[W, M, R, o, A]})#f] =newIndexedContsTContravariant[W, M, R, A] {
implicitvalW:Functor[W] =W0
implicitvalM:Functor[M] =M0
}
implicitdefIndexedContsTBifunctor[W[+_], M[+_], O](implicitW0:Functor[W], M0:Functor[M]):Bifunctor[({typef[+r, +a]=IndexedContsT[W, M, r, O, a]})#f] =newIndexedContsTBifunctor[W, M, O] {
implicitdefIndexedContsTBifunctor[W[_], M[_], O](implicitW0:Functor[W], M0:Functor[M]):Bifunctor[({typef[r, a]=IndexedContsT[W, M, r, O, a]})#f] =newIndexedContsTBifunctor[W, M, O] {
implicitvalW:Functor[W] =W0
implicitvalM:Functor[M] =M0
}
implicitdefContsTMonad[W[+_], M[+_], R](implicitW0:Comonad[W]):Monad[({typef[+a]=ContsT[W, M, R, a]})#f] =newContsTMonad[W, M, R] {
implicitdefContsTMonad[W[_], M[_], R](implicitW0:Comonad[W]):Monad[({typef[a]=ContsT[W, M, R, a]})#f] =newContsTMonad[W, M, R] {
implicitvalW:Comonad[W] =W0
}
}
private[scalaz] sealedtraitIndexedContsTFunctorLeft[W[+_], M[+_], O, A0] extendsFunctor[({typef[+r]=IndexedContsT[W, M, r, O, A0]})#f] {
private[scalaz] sealedtraitIndexedContsTFunctorLeft[W[_], M[_], O, A0] extendsFunctor[({typef[r]=IndexedContsT[W, M, r, O, A0]})#f] {
implicitvalM:Functor[M]
defmap[A, B](fa: IndexedContsT[W, M, A, O, A0])(f: A=>B):IndexedContsT[W, M, B, O, A0] = fa.imap(f)
}
private[scalaz] sealedtraitIndexedContsTFunctorRight[W[+_], M[+_], R, O] extendsFunctor[({typef[+a]=IndexedContsT[W, M, R, O, a]})#f] {
private[scalaz] sealedtraitIndexedContsTFunctorRight[W[_], M[_], R, O] extendsFunctor[({typef[a]=IndexedContsT[W, M, R, O, a]})#f] {
implicitvalW:Functor[W]
overridedefmap[A, B](fa: IndexedContsT[W, M, R, O, A])(f: A=>B):IndexedContsT[W, M, R, O, B] = fa.map(f)
}
private[scalaz] sealedtraitIndexedContsTContravariant[W[+_], M[+_], R, A0] extendsContravariant[({typef[-o]=IndexedContsT[W, M, R, o, A0]})#f] {
private[scalaz] sealedtraitIndexedContsTContravariant[W[_], M[_], R, A0] extendsContravariant[({typef[o]=IndexedContsT[W, M, R, o, A0]})#f] {
implicitvalW:Functor[W]
implicitvalM:Functor[M]
defcontramap[A, B](fa: IndexedContsT[W, M, R, A, A0])(f: B=>A):IndexedContsT[W, M, R, B, A0] = fa.contramap(f)
}
private[scalaz] sealedtraitIndexedContsTBifunctor[W[+_], M[+_], O] extendsBifunctor[({typef[+r, +a]=IndexedContsT[W, M, r, O, a]})#f] {
private[scalaz] sealedtraitIndexedContsTBifunctor[W[_], M[_], O] extendsBifunctor[({typef[r, a]=IndexedContsT[W, M, r, O, a]})#f] {
implicitvalW:Functor[W]
implicitvalM:Functor[M]
defbimap[A, B, C, D](fab: IndexedContsT[W, M, A, O, B])(f: A=>C, g: B=>D):IndexedContsT[W, M, C, O, D] = fab.bimap(f, g)
overridedefleftFunctor[X]:Functor[({typef[+r]=IndexedContsT[W, M, r, O, X]})#f] =IndexedContsT.IndexedContsTFunctorLeft
overridedefleftFunctor[X]:Functor[({typef[r]=IndexedContsT[W, M, r, O, X]})#f] =IndexedContsT.IndexedContsTFunctorLeft
overridedefleftMap[A, B, C](fa: IndexedContsT[W, M, A, O, B])(f: A=>C):IndexedContsT[W, M, C, O, B] = fa.imap(f)
overridedefrightFunctor[X]:Functor[({typef[+a]=IndexedContsT[W, M, X, O, a]})#f] =IndexedContsT.IndexedContsTFunctorRight
overridedefrightFunctor[X]:Functor[({typef[a]=IndexedContsT[W, M, X, O, a]})#f] =IndexedContsT.IndexedContsTFunctorRight
overridedefrightMap[A, B, D](fa: IndexedContsT[W, M, A, O, B])(f: B=>D):IndexedContsT[W, M, A, O, D] = fa.map(f)
}
private[scalaz] sealedtraitContsTMonad[W[+_], M[+_], R] extendsMonad[({typef[+a]=ContsT[W, M, R, a]})#f] withIndexedContsTFunctorRight[W, M, R, R] {
private[scalaz] sealedtraitContsTMonad[W[_], M[_], R] extendsMonad[({typef[a]=ContsT[W, M, R, a]})#f] withIndexedContsTFunctorRight[W, M, R, R] {
implicitvalW:Comonad[W]
defpoint[A](a: =>A):ContsT[W, M, R, A] =IndexedContsT.point(a)