Continuation Indexed Monad
Feb. 17th, 2019 07:27 pm
object IxCont {
type Cont[R, B, A] = (A => B) => R
def reset[R, A](c: Cont[R, A, A]): R = c(identity)
def shift[R, B, A](f: (A => B) => R): Cont[R, B, A] = f(_)
def suspend[A, B]: Cont[A => B, B, A] = shift(identity[A => B])
( Read more... )