From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id D97647EE86 for ; Tue, 13 Nov 2012 10:33:46 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.115; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.115 as permitted sender) identity=mailfrom; client-ip=66.39.3.115; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@www1.g3.pair.com) identity=helo; client-ip=66.39.3.115; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@www1.g3.pair.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsECADcTolBCJwNzd2dsb2JhbABExBYBDAcPBzuCJXkFFjRpFIgPukKSdQOSSoMxAYEckhY X-IronPort-AV: E=Sophos;i="4.80,765,1344204000"; d="scan'208";a="162263241" Received: from www1.g3.pair.com ([66.39.3.115]) by mail4-smtp-sop.national.inria.fr with SMTP; 13 Nov 2012 09:19:54 +0100 Received: (qmail 36139 invoked by uid 9370); 13 Nov 2012 08:19:52 -0000 Date: 13 Nov 2012 08:19:52 -0000 Message-ID: <20121113081952.36138.qmail@www1.g3.pair.com> From: oleg@okmij.org To: ivg@ieee.org CC: Didier.Cassirame@gmail.com, caml-list@inria.fr In-reply-to: <87wqxrtjtq.fsf@golf.niidar.ru> X-Validation-by: oleg@okmij.org Subject: [Caml-list] Re: Higher order functors over tuples > 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.