From: oleg@okmij.org
To: padator@wanadoo.fr
Cc: caml-list@inria.fr
Subject: Generators in OCaml
Date: Mon, 23 Aug 2010 23:53:11 -0700 (PDT) [thread overview]
Message-ID: <20100824065311.620E517415@Adric.ern.nps.edu> (raw)
In-Reply-To: <72B69466-3FAC-41AC-96ED-6024DCBD341A@wanadoo.fr>
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
prev parent reply other threads:[~2010-08-24 6:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-23 1:34 Delimited continuations in OCaml go to 3.12 and 64 oleg
2010-08-23 21:38 ` [Caml-list] " Yoann Padioleau
2010-08-24 1:20 ` Jake Donham
2010-08-24 6:53 ` oleg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100824065311.620E517415@Adric.ern.nps.edu \
--to=oleg@okmij.org \
--cc=caml-list@inria.fr \
--cc=padator@wanadoo.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox