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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id DB708BBAF for ; Fri, 25 Jul 2008 22:10:48 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcAAG/QiUjUNQVco2dsb2JhbACSWAEBAQEBAQcFCAcRnSw X-IronPort-AV: E=Sophos;i="4.31,253,1215381600"; d="scan'208";a="15504747" Received: from postbode02.versateladsl.be ([212.53.5.92]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Jul 2008 22:10:48 +0200 Received: (qmail 708 invoked by uid 0); 25 Jul 2008 20:10:44 -0000 Received: from unknown (HELO poincare.swapping.umh.ac.be) ([83.182.217.242]) (envelope-sender ) by smtp.versateladsl.be (qmail-ldap-1.03) with SMTP for < >; 25 Jul 2008 20:10:44 -0000 Received: from [127.0.0.1] (helo=localhost ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.69) (envelope-from ) id 1KMTch-0005om-9w; Fri, 25 Jul 2008 22:10:43 +0200 Date: Fri, 25 Jul 2008 22:10:43 +0200 (CEST) Message-Id: <20080725.221043.29685968146908433.Christophe.Troestler+ocaml@umh.ac.be> To: dawid.toton@uj.edu.pl Cc: OCaml Mailing List Subject: Re: [Caml-list] 'Nondeterministic' evaluation wrt exceptions From: Christophe TROESTLER In-Reply-To: <488A2988.3070402@uj.edu.pl> References: <4889F16B.3020903@uj.edu.pl> <4889FD30.9070005@inria.fr> <488A2988.3070402@uj.edu.pl> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons-Hainaut X-Mailer: Mew version 6.0.51 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0100,:01 nesting:01 monads:01 blog:98 wrote:01 caml-list:01 exceptions:01 umh:01 let:03 let:03 On Fri, 25 Jul 2008 20:29:12 +0100, Dawid Toton wrote: > > Let me show an example of what I exactly mean. I start with a code: > > 1: let a = heavy 1 > 2: let b = heavy 2 > 3: let c = report (a + b) > 4: let d = heavy 4 > 5: let e = heavy d > > Then I want to translate it automatically so that three applications of > heavy are evaluated (lines 1, 2, 4). The addition a + b won't be > evaluated untill a and b are successfully returned. (...) You may want to have a look to http://enfranchisedmind.com/blog/2007/08/06/a-monad-tutorial-for-ocaml/ especially the "Russian Nesting Doll Monads" section for ideas. Regards, ChriS