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=AWL 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 E3B78BC6B for ; Fri, 19 Oct 2007 14:47:09 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJpEGEfAXQInh2dsb2JhbACOVwIBCAop X-IronPort-AV: E=Sophos;i="4.21,300,1188770400"; d="scan'208";a="18346644" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 19 Oct 2007 14:47:09 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9JCl8Di001215 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 19 Oct 2007 14:47:09 +0200 From: luc.maranget@inria.fr (Luc Maranget) X-IronPort-AV: E=Sophos;i="4.21,300,1188770400"; d="scan'208";a="4848637" Received: from yquem.inria.fr ([128.93.8.37]) by mail3-relais-sop.national.inria.fr with ESMTP; 19 Oct 2007 14:47:08 +0200 Received: by yquem.inria.fr (Postfix, from userid 18041) id 31850BC6B; Fri, 19 Oct 2007 14:47:07 +0200 (CEST) Date: Fri, 19 Oct 2007 14:47:06 +0200 To: Christophe Raffalli Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Help me find this pdf Message-ID: <20071019124706.GA30305@yquem.inria.fr> References: <200710181457.58077.jon@ffconsultancy.com> <47176C28.1090509@janestcapital.com> <200710181818.31430.jon@ffconsultancy.com> <20071019152311.25cdf410.mle+ocaml@mega-nerd.com> <4718A220.4030708@univ-savoie.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4718A220.4030708@univ-savoie.fr> User-Agent: Mutt/1.5.9i X-Miltered: at concorde with ID 4718A74C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; maranget:01 maranget:01 ocaml:01 syntax:01 haskell:01 haskell:01 semantics:01 compilation:01 semantics:01 enclosing:01 christophe:01 raffalli:01 --luc:01 luc:01 luc:01 > > You mean that if I write (I use OCaml syntax) > > match p, q with > | (true, true) -> A > | _ -> B > > Haskell will first check if (p is evaluated and false) or (q is evaluated and false) > and then, if it is not the case will evaluate p, and finally if p is true it will evaluate q ? > Haskell has left-to-right semantics for PM. Basically this is expressed by PM compilation. "Semantics" of the above code is given by: match p with | true -> (match q with true -> A | _ -> goto next enclosing "_") | _ -> B Hence if _|_ is a symbol for looping computation, and ? is a symbol for just anything (in {_|_, true, false}), we have: p q -> result _|_ ? -> _|_ true _|_ -> _|_ true true -> A true false -> B false ? -> B > > > -- > Christophe Raffalli In case you are really interested by the issue, may I mention one of my recent papers on warnings for pattern matching (See section 4.) --Luc