English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Delimited continuations in OCaml go to 3.12 and 64
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-08-24 (06:53)
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:

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