Browse thread
Delimited continuations in OCaml go to 3.12 and 64
-
oleg@o...
-
Yoann Padioleau
- Jake Donham
- oleg@o...
-
Yoann Padioleau
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | oleg@o... |
| Subject: | Generators in OCaml |
Yoann Padioleau wrote: > Is there any tutorial on why such features are useful ? > Concrete examples of their use. Thank you for the question! I think you may find many examples of delimited continuations on the following web site: http://okmij.org/ftp/Computation/Continuations.html Notable examples are the probabilistic programming language HANSEI, normalization of MapReduce bodies by evaluation, and a framework to program CGI applications in `direct style' (as if they were regular console applications). Delimited continuations proved quite useful for writing code generators: to perform let- or if-insertions in the generated code, one has two choices: write the generator in a monadic style or CPS, or use a `direct style' relying on delimited control. Experience seems to show that direct-style generators are more perspicuous. > For instance can you implement python generators and its yield stuff > by using this library ? Yes! Here is the complete code http://okmij.org/ftp/ML/generator.ml