caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jacques Carette" <carette@mcmaster.ca>
To: Oliver Bandel <oliver@first.in-berlin.de>,
	Inria Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Monads-Module for the Standard-OCaml-Distribution?!
Date: Wed, 11 May 2005 10:14:15 -0400	[thread overview]
Message-ID: <web-92066943@cgpsrv2.cis.mcmaster.ca> (raw)
In-Reply-To: <20050511100831.GA490@first.in-berlin.de>

I definitely support the inclusion of Monad-related features to Ocaml.  However, without some syntactic sugar, this is 
rather difficult to use.

I have discussed this in a previous message to this list [which unfortunately cannot be retrieved from the caml-list 
archives because somehow multipart/MIME messages are not handled properly by the archiver].  However, it is archived 
here:
https://mailman.rice.edu/pipermail/metaocaml-users-l/2005-March/000056.html

The camlp4 extension above has some flaws (as pointed out to me by Lydia van Dijk):
1) extra { } that are not needed
2) which monad is used is unclear
3) using multiple monads in the same program is difficult

Very helpfully, Lydia has provided me with an updated version of pa_monad.ml that fixes these.  I unfortunately have 
not had the time to convert all my monadic programs to this new notation - as a "real" test that the new notation does 
work.  As soon as I confirm this, I will send an email to caml-list with this improved notation.

Having a standard library of Monads that can easily be used with a monadic 'do' notation in Ocaml would definitely be 
very nice.

Interestingly, here Ocaml can do something which cannot be done in Haskell: it is possible to use the object system to 
encapsulate Monads in a novel way.  Because objects are first-class in Ocaml, a lot more can be done with them than in 
Haskell, where one must live within the confines of the typeclass system for manipulating Monads.  While I have not 
explored this enough, 'Monad Transformers' could become much easier to do in Ocaml than in Haskell!

Jacques


      reply	other threads:[~2005-05-11 14:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-11 10:08 Oliver Bandel
2005-05-11 14:14 ` Jacques Carette [this message]

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=web-92066943@cgpsrv2.cis.mcmaster.ca \
    --to=carette@mcmaster.ca \
    --cc=caml-list@inria.fr \
    --cc=oliver@first.in-berlin.de \
    /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).