Skip to content

Instantly share code, notes, and snippets.

@ttim
Created April 26, 2019 00:38
Show Gist options
  • Save ttim/5f33ace5177a2e44e81cca4ab24d0bc0 to your computer and use it in GitHub Desktop.
Save ttim/5f33ace5177a2e44e81cca4ab24d0bc0 to your computer and use it in GitHub Desktop.
StacklessRecursion
object StacklessRecursion {
type TrampolineK[B[_]] = ({ type Trampolined[T] = Trampoline[B[T]] })#Trampolined
def computeK[A[_], B[_], T](
f: RecursiveK[A, TrampolineK[B]],
maxStack: Int = 100
)(value: A[T]): B[T] = ???
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment