A monadic framework for delimited continuations