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 JAA29848; Mon, 19 Nov 2001 09:11:20 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA29344 for ; Mon, 19 Nov 2001 09:11:20 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fAJ8BJb06607 for ; Mon, 19 Nov 2001 09:11:19 +0100 (MET) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA29882 for caml-list@inria.fr; Mon, 19 Nov 2001 09:11:19 +0100 (MET) Date: Mon, 19 Nov 2001 09:11:19 +0100 From: Francois Pottier To: caml-list@inria.fr Subject: Re: [Caml-list] Re: variance, subtyping and monads... oh, my! Message-ID: <20011119091119.A29570@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <002001c17035$c722aa80$3363e195@pazo> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: ; from jhw@wetware.com on Sun, Nov 18, 2001 at 02:30:25PM -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello everyone, Just a few thoughts about this discussion. As Andreas and Alan said, there is no need to understand ocaml's object system in order to experiment with functional programming. The core features of ocaml are functions, (possibly mutable) data structures and pattern matching, exceptions, and modules. These features do not require subtyping at all. Notions of subtyping appear when using objects or so-called `polymorphic' variants. James Woodyatt wrote: > I'm guessing that these "purer forms" of functional programming involve > convoluted gyrations with monads and the higher order "things" that you > can construct with them by layering them one on top of the other. I don't think that's what Andreas meant. I think `pure' merely meant `non-OO' here. > Now, is it my imagination, or is all that research into what you can > build out of monads primarily a way for Haskell people to rediscover > everything we already know about polymorphism, inheritance and > encapsulation? Isn't that a bit harsh? Monads offer abstraction with respect to the way certain side effects are performed. Because of ocaml's natural support for many side effects (references, exceptions, I/O, ...), monads are seldom needed in ocaml. Furthermore, because of ocaml's lack of support for overloading, their use is more cumbersome in ocaml than in Haskell. Nevertheless, I am sure there are situations where abstracting your code with respect to a monad is desirable. For instance, if you're writing non-deterministic code, you may want the machinery that explores multiple threads of evaluation, handles backtracking, etc. to be hidden inside a monad. > As near as I can tell, OCaml doesn't keep me from building monads if I > really feel a deep and burning need to do so, but for the life of me I > can't figure out what I might get out of it that would be useful and new. Sounds perfectly OK. -- François Pottier Francois.Pottier@inria.fr http://pauillac.inria.fr/~fpottier/ ------------------- 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