caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Paul Snively <psnively@mac.com>
To: Jacques Carette <carette@mcmaster.ca>
Cc: caml-list@inria.fr, lvandijk@freenet.de, oleg@pobox.com
Subject: Re: [Caml-list] pa_monad 1.0 - syntax extension for monads
Date: Sat, 10 Jun 2006 19:28:18 -0700	[thread overview]
Message-ID: <76F9DF98-BFD4-4308-9CA2-F0D79BD507B7@mac.com> (raw)
In-Reply-To: <44872ABF.2020307@mcmaster.ca>

Jacques, Lydia, and Oleg,

Thanks so much for this! It's almost embarrassing to ask for more,  
but I'm going to anyway:

1) It isn't clear how to build a native version of the release,  
although the Makefile appears to contemplate doing so.
2) It would be nice if the release were integrated with findlib.
3) It would be nice if Oleg's monadic delimited continuations were  
revised to be as nicely supported by pa_monad as the IO, Exception,  
and Nondet monads that are included with the distribution are.

I will poke around at all three of these issues myself. In the  
meantime, thanks again for a great tool!

Best regards,
Paul

On Jun 7, 2006, at 12:36 PM, Jacques Carette wrote:

> We are pleased to announce the release of the stable version our  
> syntax extension for monadic expressions in Ocaml.
>
> All the details can be obtained from http://www.cas.mcmaster.ca/ 
> ~carette/pa_monad/ .
>
> Example: A simple but realistic example of the use of a list monad  
> looks like this
>
>        bind
>          [1; 2; 3]
>          (fun a -> bind
>                      [3; 4; 5]
>                      (fun b -> return (a + b)))
>
> where we assume the appropriate definitions of the functions "bind"  
> and "return". With the help of "pa_monad" this can be written as
>
>        perform
>          a <-- [1; 2; 3];
>          b <-- [3; 4; 5];
>          return (a + b)
>
> which is much clearer and thus easier to understand and maintain.  
> By the way, the expression evaluates to [4; 5; 6; 5; 6; 7; 6; 7; 8]  
> the sum of each pair of values of the input lists.
>
> Highlights:
>
> - Efficient code: The generated code is as efficient as hand-coded.
> - Highly flexible: The "bind" and "failwith" functions can be
>  specified in various ways
>  (a) Binding with default names:
>          perform ...
>  (b) Binding with user-defined names:
>          perform with my_bind and my_failwith in ...
>  (c) One-of-a-kind binding:
>          perform with fun a f -> f a and ... in ...
>  (d) Module-based binding:
>          perform with MyMonad in ...
>      or with OCaml's local modules:
>          let foo ... =
>            let module MyMonad = ... in
>            perform with MyMonad in ...
>
> The package for this extension contains more examples as well as  
> some self-tests and an extensive README with yet more details  
> (including a patch to tuareg-mode).  In the source code (and the  
> generated ocamldoc html), one can find amongst other things an  
> informal and formal description of the grammar of the extension,  
> and a (rewriting) semantics for the extension.
>
> This code is licensed under the GNU library general public license,  
> compatible with Ocaml's own license.
>
> All feedback welcome,
> Jacques Carette, Lydia E. van Dijk and Oleg Kiselyov
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


  reply	other threads:[~2006-06-11  2:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-07 19:36 Jacques Carette
2006-06-11  2:28 ` Paul Snively [this message]
2006-06-23 17:38   ` pa_monad 1.1 Jacques Carette

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=76F9DF98-BFD4-4308-9CA2-F0D79BD507B7@mac.com \
    --to=psnively@mac.com \
    --cc=caml-list@inria.fr \
    --cc=carette@mcmaster.ca \
    --cc=lvandijk@freenet.de \
    --cc=oleg@pobox.com \
    /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).