Create a gist now

Instantly share code, notes, and snippets.

Trampolining the state monad (doesn't work)
import scalaz._, Scalaz._
def setS(i: Int): State[List[Int], Unit] = modify(i :: _)
val s = (1 to 10000).foldLeft(state[List[Int], Unit](()).lift[Free.Trampoline]) {
case (st, i) => st.flatMap(_ => setS(i).lift[Free.Trampoline])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment