I'm trying to understand how to use the ContT
monad transformer in Scalaz 7 to implement a while
loop in a functional way while preventing stack overflows. A simple example illustrating the usage of ContT
would be very helpful.
Asked
Active
Viewed 154 times
2

Martin Studer
- 2,213
- 1
- 18
- 23
-
Rather than using `ContT` for implementing a while loop in a functional way I came across scalaz' `Monad.whileM_`. While this seems to work fine in general, I still need to sort out stack safety: http://stackoverflow.com/questions/30652980/trampolining-scalaz-monad-whilem-to-prevent-stack-overflow – Martin Studer Jun 04 '15 at 19:58