Internal class representing a tailcall
Internal class representing a continuation with function A => TailRec[B].
Internal class representing the final result returned from a tailcalling computation
This class represents a tailcalling computation
Used to return final result from tailcalling computation
Used to return final result from tailcalling computation
a TailRec
object representing a computation which immediately
returns result
Performs a tailcall
Performs a tailcall
the expression to be evaluated in the tailcall
a TailRec
object representing the expression rest
Methods exported by this object implement tail calls via trampolining. Tail calling methods have to return their result using
done
or call the next method usingtailcall
. Both return aTailRec
object. The result of evaluating a tailcalling function can be retrieved from aTailrec
value using methodresult
. Implemented as described in "Stackless Scala with Free Monads" http://blog.higher-order.com/assets/trampolines.pdfHere's a usage example: