caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alex Baretta <alex@barettadeit.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] 'a Set?
Date: Wed, 26 Jan 2005 17:00:15 +0100	[thread overview]
Message-ID: <41F7BE8F.5090101@barettadeit.com> (raw)
In-Reply-To: <20050126.210400.42882977.garrigue@math.nagoya-u.ac.jp>

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/>


  reply	other threads:[~2005-01-26 16:00 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 [this message]
2005-01-26 16:14           ` Jacques Carette
2005-01-26 21:09           ` Mike Hamburg
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=41F7BE8F.5090101@barettadeit.com \
    --to=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).