Browse thread
'a Set?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Mike Hamburg <hamburg@f...> |
| Subject: | Re: [Caml-list] 'a Set? |
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 >