Welcome! Got a question? Do you have -Ypartial-unification turned on? Other FAQs: http://typelevel.org/cats/faq.html
WriterT[F, Log, ?]
as your F
would be fine except then F
failures don't get logged
Either[Throwable
to catch the F
errors
def st: State[S, List[A]]
def modo(f: A => B): IndexedState[S, T, List[A]] =
Bifunctor[IndexedStateT[Eval, S, ?, ?]].leftMap(st)(traversal.modify(f))
def modo2(f: A => B): IndexedState[S, T, List[A]] =
(st: IndexedStateT[Eval, S, S, List[A]]).leftMap(traversal.modify(f))
foldMap
is
foldMap
on List
, Coyoneda
, Free
and FreeApplicative
List/Coyoneda/Free/FreeApplicative
as programs of a specific shape, which are parameterised by their instructions, then foldMap
says: "give me a translation between instructions, and I'll give you a translation between programs "
foldMap
on List
, Free
, FreeApplicative
and Coyoneda
- List
def foldMap[A, B](fa: List[A])(f: A => B)(implicit B: Monoid[B]): B
- Free
final def foldMap[M[_]](f: S ~> M)(implicit M: Monad[M]): M[A]
- ApplicativeFree
final def foldMap[G[_]](f: F ~> G)(implicit G: Applicative[G]): G[A]
- Coyoneda
final def foldMap[G[_]](trans: F ~> G)(implicit G: Functor[G]): G[A]
"give me a translation between instructions, and I'll give you a translation between programs "
I am familiar to using Free monads as interpreters of grammars written as GADTs
put
, which represents the concept of outputting a String