foldRightM laziness

16 views
Skip to first unread message

Alexey Ivanov

unread,
Jul 11, 2016, 2:42:03 PM7/11/16
to scalaz
Hi,

I'm noticed that foldRightM fold function (f) is lazy by it's second argument:

def foldRightM[G[_], A, B](fa: F[A], z: ⇒ B)(f: (A, ⇒ B) ⇒ G[B])(implicit M: Monad[G]): G[B]

What is the point of making it lazy? Isn't it still need to compute monadic value G[B] before passing it to f?

Thanks.
Reply all
Reply to author
Forward
0 new messages