Calling monadic bind flatMap
may cause some confusion. flatMap
is very list (or container) specialised name which gives false intuition. Even worse is to call monadic join flatten
. Monadic join isn't very good name either, if you drop monadic.
OTOH: flatten
does flatten type structure, F[F[A]] => f[A]
, but I'm not sure how many of us think on the type-level first.
I'm very glad that in scalaz monadic bind is bind
. Unfortunately Scala's for
comprehension desugars into flatMap
's, AFAIK.
One (a bit contrived) example:
https://github.com/phadej/playground/blob/master/scala/src/main/scala/homogenicpair.scala