From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id ADD97BB91 for ; Sat, 29 Jan 2005 02:37:35 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0T1bYNn002104 for ; Sat, 29 Jan 2005 02:37:34 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA13869 for ; Sat, 29 Jan 2005 02:37:34 +0100 (MET) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0T1bXRf006138 for ; Sat, 29 Jan 2005 02:37:33 +0100 Received: by rproxy.gmail.com with SMTP id a41so991873rng for ; Fri, 28 Jan 2005 17:37:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=LTuqOGt2Y9JAi4gLjIzhURCz5jmSrzB4OgqMWyV1tIfBUn4VoC5GSZOHSCefVZMNrEKiek3MIaRAq3h7SeC86Ue1FPSUdgbRg+cwcPPGDSYtByeFVvv5oDXYBGoPgNBtZrEogZ79sXjH1FK21jH7ZQb5VrqDGFmosSywJmtGnSc= Received: by 10.38.59.26 with SMTP id h26mr467391rna; Fri, 28 Jan 2005 17:37:32 -0800 (PST) Received: by 10.38.86.80 with HTTP; Fri, 28 Jan 2005 17:37:32 -0800 (PST) Message-ID: <877e9a1705012817373f82194c@mail.gmail.com> Date: Fri, 28 Jan 2005 20:37:32 -0500 From: Michael Walter Reply-To: Michael Walter To: skaller@users.sourceforge.net Subject: Re: [Caml-list] Re: '_a Cc: Keith Wansbrough , Stefan Monnier , caml-list In-Reply-To: <1106927299.23562.187.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1106927299.23562.187.camel@pelican.wigram> X-Miltered: at concorde with ID 41FAE8DE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41FAE8DD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 ocaml:01 haskell:01 ocaml:01 afaik:01 o'caml:01 haskell:01 monads:01 ...:98 ...:98 exceptions:01 define:01 binding:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.0 X-Spam-Level: On 29 Jan 2005 02:48:20 +1100, skaller wrote: > [...] > > OCaml already has > > one: return is implicit, bind is called ";", and the monad operations > > include "raise" and "try ... with ...". > > Indeed, but that isn't necessarily a good monad > for all purposes (otherwise Haskell would be Ocaml > and wouldn't have any typeclasses .. LOL :) This is indeed pretty much the IO monad (AFAIK O'caml). return: (implicit) >>: ; fail: raise catch: try ... with ... (not part of the Monad type class) > In particular, raise is very nasty -- I can't say this > very well, but 'the monad is too global'. It's way too > powerful -- and thus too hard to reason about. Hum. > You can't predict what a function will throw from its > interface, so you basically have lost control of your program. > > As I understand it, Haskell style monads provide > better localisation (is that right?) As you define binding by yourself, you have all possibilities to propagate errors, such as implementation exceptions, etc. Simple examples are Maybe and Either. And IO, obviously ;-) Michael