Internal class representing a tailcall
Internal class representing a tailcall
Internal class representing a continuation with function A => TailRec[B].
Internal class representing a continuation with function A => TailRec[B]. It is needed for the flatMap to be implemented.
Internal class representing the final result returned from a tailcalling computation
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
doneor call the next method usingtailcall. Both return aTailRecobject. The result of evaluating a tailcalling function can be retrieved from aTailrecvalue using methodresult. Implemented as described in "Stackless Scala with Free Monads" http://blog.higher-order.com/assets/trampolines.pdfHere's a usage example: