Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Functors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-02 (17:18)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] Functors
On Sun, May 02, 2004 at 06:24:15PM +0800, Martin Jambon wrote:

> With my words: I understand functors as a way to parametrize a type with a
> value.
> They allow you to detect inconsistencies at compile time (e.g. 2 sets
> parametrized with different "compare" functions).
> Without functors, as far as I know, you can only test inconsistencies at
> run time (e.g. by putting all the parameters in a record an check physical
> equality of the records).

Unless the compare function is only an argument of the set creation
routine, and the value is part of the set itself.  There might be
performance issues with an extra field, though.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: