def flatMapF[B](f: A => F[B])(implicit F: Monad[F]): OptionT[F, B]
whereas the signature of flatMapF in ListT is
def flatMapF[B](f: A => M[List[B]])(implicit M: Monad[M]) : ListT[M, B]
Me thinks, both can't be right. I would favour the version of OptionT, as OptionT and ListT have defined flatMap in the style of:
def flatMap[B](f: A => OptionT[F, B])(implicit F: Monad[F]): OptionT[F, B] (for ListT with ListT respectively).
Regards
Markus
def flatMapF[B](f: A => M[B])(implicit M: Monad[M], T: Traverse[List]) : ListT[M, B] = new ListT[M,B] (
M.bind(run) { list =>
T.traverse(list)(f)
}
)
Is this correct, the right approach? Markus