From: oleg@okmij.org
To: ivg@ieee.org
Cc: Didier.Cassirame@gmail.com, caml-list@inria.fr
Subject: [Caml-list] Re: Higher order functors over tuples
Date: 13 Nov 2012 08:19:52 -0000 [thread overview]
Message-ID: <20121113081952.36138.qmail@www1.g3.pair.com> (raw)
In-Reply-To: <87wqxrtjtq.fsf@golf.niidar.ru>
> And, by the way, I've met the following signatures many times in
> different frameworks written in different languages (matlab functional
> objects, GnuRadio blocks, to name a few):
>> module type Generator =
>> sig
>> type t
>> type r
>> val create: unit -> t
>> val result: t -> r option
>> val step: t -> t option
>> end
Well, if we re-write it in object style, but without objects, we obtain
type 'r stream_v = EOF | Stream of 'r option * 'r stream
and 'r stream = unit -> 'r stream_v
which is what it says. Here's the important paper that describes the
pattern in great detail and with many applications:
Duncan Coutts and Roman Leshchinskiy and Don Stewart
Stream Fusion. From Lists to Streams to Nothing at All
ICFP 07
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.104.7401
Incidentally, iteratees are somewhat similar.
next prev parent reply other threads:[~2012-11-13 9:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-06 11:48 [Caml-list] " oleg
2012-11-12 6:29 ` [Caml-list] " Ivan Gotovchits
2012-11-13 8:19 ` oleg [this message]
2012-11-15 3:17 ` Ivan Gotovchits
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=20121113081952.36138.qmail@www1.g3.pair.com \
--to=oleg@okmij.org \
--cc=Didier.Cassirame@gmail.com \
--cc=caml-list@inria.fr \
--cc=ivg@ieee.org \
/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;
as well as URLs for NNTP newsgroup(s).