From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA07095; Sun, 2 May 2004 19:18:25 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA07258 for ; Sun, 2 May 2004 19:18:24 +0200 (MET DST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i42HINEV002015 for ; Sun, 2 May 2004 19:18:23 +0200 Received: from davidb by mail.davidb.org with local (Exim 3.36 #1 (Debian)) id 1BKKbU-0006eT-00; Sun, 02 May 2004 10:18:12 -0700 Date: Sun, 2 May 2004 10:18:12 -0700 From: David Brown To: Martin Jambon Cc: Jon Harrop , caml-list@inria.fr Subject: Re: [Caml-list] Functors Message-ID: <20040502171812.GA25467@davidb.org> References: <200405021012.28011.jdh30@cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Miltered: at nez-perce with ID 40952D5F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 caml-list:01 functors:01 2004:99 functors:01 equality:01 compile:02 jambon:02 dave:03 wrote:03 argument:03 0800,:04 functions:05 parameters:05 detect:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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. Dave ------------------- 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