caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois Pottier <francois.pottier@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Re: variance, subtyping and monads... oh, my!
Date: Mon, 19 Nov 2001 09:11:19 +0100	[thread overview]
Message-ID: <20011119091119.A29570@pauillac.inria.fr> (raw)
In-Reply-To: <DCC4EB14-DC73-11D5-963F-000502DB38F5@wetware.com>; from jhw@wetware.com on Sun, Nov 18, 2001 at 02:30:25PM -0800


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


  reply	other threads:[~2001-11-19  8:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-16 19:37 [Caml-list] [Q]: Co(ntra)variance and subtyping? Clemens Hintze
2001-11-17 14:18 ` Mark Wotton
2001-11-17 14:55   ` Mark Wotton
2001-11-17 17:50   ` [Caml-list] " Clemens Hintze
2001-11-17 23:17     ` Mark Wotton
2001-11-18  9:16       ` Clemens Hintze
2001-11-18 13:18         ` Alain Frisch
2001-11-19  9:54           ` Remi VANICAT
     [not found]       ` <9t7v4d$gij$1@qrnik.zagroda>
2001-11-18 11:57         ` Marcin 'Qrczak' Kowalczyk
2001-11-18 13:34 ` [Caml-list] " Andreas Rossberg
2001-11-18 21:22   ` Pixel
2001-11-19  0:33     ` Jacques Garrigue
2001-11-18 22:35       ` David Gurr
2001-11-19  7:24         ` [Caml-list] " Clemens Hintze
2001-11-19 12:03           ` Markus Mottl
2001-11-19  8:29         ` [Caml-list] " Xavier Leroy
2001-11-19 11:03       ` Alain Frisch
2001-11-20  9:58         ` Didier Remy
2001-11-19 11:14       ` Pixel
2001-11-18 22:30   ` [Caml-list] Re: variance, subtyping and monads... oh, my! james woodyatt
2001-11-19  8:11     ` Francois Pottier [this message]
2001-11-19  9:02       ` james woodyatt
2001-11-19  9:58         ` Markus Mottl
2001-11-19 20:47           ` james woodyatt
2001-11-19 12:56       ` Frank Atanassow
2001-11-19 10:39     ` Andreas Rossberg
2001-11-19 12:21       ` Markus Mottl
2001-11-19 13:43         ` [Caml-list] Kylix and OCaml Christophe Raffalli
2001-11-20  2:05           ` Vitaly Lugovsky
2001-11-20  8:51             ` Christophe Raffalli
2001-11-22  1:42               ` Vitaly Lugovsky
2001-11-20 10:00             ` Benjamin Monate
2001-11-20 10:24               ` [Caml-list] [Bug in an interface between C++ and OCAML due to some pointer encapsulation] Sylvain Kerjean
2001-11-20 12:14             ` [Caml-list] Kylix and OCaml Maxence Guesdon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011119091119.A29570@pauillac.inria.fr \
    --to=francois.pottier@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).