Skip to content

Instantly share code, notes, and snippets.

(* A tagless-final embedding of the language with shift/reset
operators and fully supported answer-type modification (ATM).
This implementation is based on the prompt-passing translation
described in the paper "ATM without tears: prompt-passing style
transformation for typed delimited-control operators"
http://ebooks.au.dk/index.php/aul/catalog/view/4/4/31-1
*)
open Delimcc;;
@funikk
funikk / mnf.ml
Last active August 29, 2015 13:57
Monadic Normal Form transform using shift/reset.
open Delimcc;;
type id = string
type exp =
| Var of id
| Fun of id * exp
| Const of int
| BinOp of exp * exp
| App of exp * exp