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 (13:34)
From: Jon Harrop <jdh30@c...>
Subject: Re: [Caml-list] Functors
On Sunday 02 May 2004 11:24, Martin Jambon wrote:
> On Sun, 2 May 2004, Jon Harrop wrote:
> > 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?
> Unfortunately no.
> ...

Wow, ok. So ocamldefun maps ocaml code with functors onto ocaml code without 
functors and, according to their examples, this can result in an 8 times 
performance improvement due to inlining.

This begs the question: why is this functionality not in the compiler? In 
fact, using functors with the current compiler actually reduces 


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