caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mike Hamburg <hamburg@fas.harvard.edu>
To: Alex Baretta <alex@barettadeit.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] 'a Set?
Date: Wed, 26 Jan 2005 16:09:24 -0500	[thread overview]
Message-ID: <8E480565-6FDE-11D9-8411-0003939A19AA@fas.harvard.edu> (raw)
In-Reply-To: <41F7BE8F.5090101@barettadeit.com>

I call this operator <?>, because I often use it like so:

List.map (List.nth <?> 3) myList;;

Sadly, at toplevel <?> makes you lots of pretty '_a that restrict your 
future actions.  See my next post for questions about '_a.

Mike

On Jan 26, 2005, at 11:00 AM, Alex Baretta wrote:

> Jacques Garrigue wrote:
>> From: Radu Grigore <radugrigore@gmail.com>
>
>> If you respect this convention, the type tells you about the semantics
>> :-)
>
> There are two different patterns for function signatures: the Hashtbl 
> pattern and the Map pattern. Both are "good", depending on the 
> context. Since I need both approaches I have come up with a little 
> trick to get the best of both worlds.
>
> # let (~%) f = fun x y -> f y x
>
> The ~% operator swaps the first and the second parameter in a function 
> call. The following is a trivial example of its use.
>
> # ~% Printf.kprintf "Hello %s!" failwith "World";;
> Exception: Failure "Hello World!".
>
> Alex
>
> -- 
> *********************************************************************
> http://www.barettadeit.com/
> Baretta DE&IT
> A division of Baretta SRL
>
> tel. +39 02 370 111 55
> fax. +39 02 370 111 54
>
> Our technology:
>
> The Application System/Xcaml (AS/Xcaml)
> <http://www.asxcaml.org/>
>
> The FreerP Project
> <http://www.freerp.org/>
>
> _______________________________________________
> 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
>


  parent reply	other threads:[~2005-01-26 21:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25 23:54 Mike Hamburg
2005-01-26  8:25 ` [Caml-list] " Jean-Christophe Filliatre
2005-01-26 10:13   ` Frédéric Gava
2005-01-26 11:04     ` Radu Grigore
2005-01-26 12:04       ` Jacques Garrigue
2005-01-26 16:00         ` Alex Baretta
2005-01-26 16:14           ` Jacques Carette
2005-01-26 21:09           ` Mike Hamburg [this message]
2005-01-29  9:55         ` Radu Grigore
2005-01-26  9:13 ` Jon Harrop
2005-01-26 15:36   ` Frédéric Gava
2005-01-26 16:06     ` Jon Harrop

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=8E480565-6FDE-11D9-8411-0003939A19AA@fas.harvard.edu \
    --to=hamburg@fas.harvard.edu \
    --cc=alex@barettadeit.com \
    --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).