caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Functors
@ 2004-05-02  9:12 Jon Harrop
  2004-05-02 10:24 ` Martin Jambon
  0 siblings, 1 reply; 22+ messages in thread
From: Jon Harrop @ 2004-05-02  9:12 UTC (permalink / raw)
  To: caml-list


Could Set (and others) be implemented polymorphically by using a comparison 
function passed as an argument?

If so, what would be the implications of this approach? I think: you couldn't 
use the type checker to enforce consistent comparison functions between two 
different sets which were, say, being merged. I think you can enforce this 
using the functor approach provided the Sets came from the same functor 
"instantiation".

Functors appear to be somewhat similar to templates in C++. Does the functor 
approach produce more efficient code as it is partially specialised over the 
comparison function?

Also, can functors map to functors as well as modules? If so, code could be 
progressively specialised...

Cheers,
Jon.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2004-05-06 21:14 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-02  9:12 [Caml-list] Functors Jon Harrop
2004-05-02 10:24 ` Martin Jambon
2004-05-02 13:34   ` Jon Harrop
2004-05-02 14:12     ` skaller
2004-05-02 16:49       ` Jon Harrop
2004-05-03  0:20         ` skaller
2004-05-03 14:43           ` Jacques Carette
2004-05-03 16:09             ` Alain.Frisch
2004-05-03 18:53               ` Jacques Carette
2004-05-03 19:17                 ` [Caml-list] Mathematica Jon Harrop
2004-05-03 22:51                 ` [Caml-list] Functors Alain.Frisch
2004-05-03 16:02     ` Julien Signoles
2004-05-03 18:41       ` Jon Harrop
2004-05-04  7:25         ` Jean-Christophe Filliatre
2004-05-05  8:15         ` Julien Signoles
2004-05-05 20:41           ` brogoff
2004-05-06 11:16             ` Jon Harrop
2004-05-06 20:23               ` Alain.Frisch
2004-05-06 18:26                 ` Olivier Grisel
2004-05-06 12:26             ` Julien Signoles
2004-05-06 16:35               ` brogoff
2004-05-02 17:18   ` David Brown

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).