From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA02810; Mon, 19 Nov 2001 13:46:55 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA03308 for caml-list@pauillac.inria.fr; Mon, 19 Nov 2001 13:46:54 +0100 (MET) 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 KAA31750 for ; Mon, 19 Nov 2001 10:58:50 +0100 (MET) Received: from chopin.ai.univie.ac.at (chopin.ai.univie.ac.at [131.130.174.170]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id fAJ9wn113964 for ; Mon, 19 Nov 2001 10:58:49 +0100 (MET) Received: (from markus@localhost) by chopin.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id KAA29704; Mon, 19 Nov 2001 10:58:42 +0100 Date: Mon, 19 Nov 2001 10:58:42 +0100 From: Markus Mottl To: james woodyatt Cc: The Trade Subject: Re: [Caml-list] Re: variance, subtyping and monads... oh, my! Message-ID: <20011119105842.A29501@chopin.ai.univie.ac.at> References: <20011119091119.A29570@pauillac.inria.fr> <2B0C11B2-DCCC-11D5-B196-000502DB38F5@wetware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <2B0C11B2-DCCC-11D5-B196-000502DB38F5@wetware.com>; from jhw@wetware.com on Mon, Nov 19, 2001 at 01:02:33 -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 19 Nov 2001, james woodyatt wrote: > On Monday, November 19, 2001, at 12:11 , Francois Pottier wrote: > > Isn't that a bit harsh? > > Maybe. I'm more of a developer than a researcher. As with any > research, it's not useful to me until I know how and why to apply it. Even in OCaml people sometimes decide to apply monads. Just take a look at the FFTW-library, whose code generator is implemented in OCaml: http://www.fftw.org The simplification engine for DAGs used there represents rewrite rules with monad operators. This way they "look" as if they were normal tree-rewrite rules, whereas in fact the monad operators hide the whole graph rewriting that happens "behind the scene". I could surely imagine other, maybe even more efficient ways of doing it, but I fear it will be difficult to find anything that is only closely as elegant (and easily verifiable!). > If by using monads, on the other hand, I can do something easily that > would otherwise be very awkward, then I'm sold. So far, I have only > found examples of how to do things I can already do better with the > imperative and object-oriented styles in OCaml. Objects are useful abstractions for states, whereas monads are abstractions of computations (i.e. state transformations, like e.g. rewriting steps as above). These two things solve different problems so it wouldn't make much sense saying that one is "better" than the other. Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr