From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B7B87BC69 for ; Tue, 16 Oct 2007 01:02:42 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEaOE0fAXQImh2dsb2JhbACOSAEBAQgKKYEn X-IronPort-AV: E=Sophos;i="4.21,279,1188770400"; d="scan'208";a="18047559" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 16 Oct 2007 01:02:42 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9FN2d0d014906 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 16 Oct 2007 01:02:42 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEaOE0dQW+UCn2dsb2JhbACOSAEBAQEHBAYJCBiBJw X-IronPort-AV: E=Sophos;i="4.21,279,1188770400"; d="scan'208";a="3003833" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail1-smtp-roc.national.inria.fr with ESMTP; 16 Oct 2007 01:02:39 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IhYwi-0000Ub-L4 for caml-list@inria.fr; Mon, 15 Oct 2007 23:02:00 +0000 Received: from ivr94-8-88-162-26-239.fbx.proxad.net ([88.162.26.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Oct 2007 23:02:00 +0000 Received: from li by ivr94-8-88-162-26-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Oct 2007 23:02:00 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Zheng Li Subject: Re: Functional design for a basic simulation pipe. Date: Tue, 16 Oct 2007 01:04:18 +0200 Message-ID: <87abqkugi5.fsf@pps.jussieu.fr> References: <470C8199.4080708@inescporto.pt> <87fy0hvr15.fsf@pps.jussieu.fr> <470E29B6.4060502@inescporto.pt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ivr94-8-88-162-26-239.fbx.proxad.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:lnC4AwZJPAno9vWOtQhe67KGpJo= Sender: news X-Miltered: at discorde with ID 4713F18F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; hmmm:01 combinators:01 combinators:01 recursion:01 simulated:01 ocaml's:01 recursive:01 simulate:01 ocaml:01 workarounds:01 recursive:01 variants:01 camlp:01 blog:98 burdens:98 Hi, Hugo Ferreira writes: > Hmmm... these combinators seem to be well understood. Know of any > description (article, blog, etc) of these in a functional programming > setting? These combinators pervasively exist in functional languages and other declarative style languages. There's no authoritative definition though, they vary from language to language, with some slight differences. > I see that recursion as shown above could be useful: one of the > outputs would simply be an input to another stream generator. Yes. This _could_ be directly simulated with OCaml's recursive values if not for the restriction I mentioned before. > I (think) I see what you mean. Things seem to be coming together. What > you are saying is that I could use this "delay" so that only when the > value is available would it be "passed back" to the "stream generator" > thereby providing the "feedback" I need. In fact this "delay" is more > general and could be used to define various types of flows. Nice! The "delay" like facilities are usually provided as language primitives in dataflow languages, not in the library space. I can't figure out how to simulate it through plain OCaml and still keeping a combinatorial interface at the same time. I can image some workarounds to relax the restriction: recursive function, reference, variants, but all of them come with some syntactic burdens and can hardly used as combinators directly. On the other hand, there is still some possibility of making camlp4 extension to do that. I just haven't got chance to do any investigation on that. Btw, I just cleaned up some old code and will release it right now. I'm not sure whether it can help directly in your case, but I hope so. Regards -- Zheng Li http://www.pps.jussieu.fr/~li