From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,DNS_FROM_RFC_BOGUSMX autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 57F15BC6B for ; Tue, 30 Oct 2007 19:50:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHsZJ0fAXQImh2dsb2JhbACOYQIBCAop X-IronPort-AV: E=Sophos;i="4.21,348,1188770400"; d="scan'208";a="3848399" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Oct 2007 19:50:02 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9UInxcZ001476 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 30 Oct 2007 19:50:02 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHsZJ0dAahQhh2dsb2JhbACOYQIBCAop X-IronPort-AV: E=Sophos;i="4.21,348,1188770400"; d="scan'208";a="3848398" Received: from mail.cs.unm.edu ([64.106.20.33]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Oct 2007 19:50:01 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.cs.unm.edu (Postfix) with ESMTP id DD419E4176; Tue, 30 Oct 2007 12:49:57 -0600 (MDT) Received: from mail.cs.unm.edu ([127.0.0.1]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20987-08; Tue, 30 Oct 2007 12:49:57 -0600 (MDT) Received: from cs.unm.edu (webmail.cs.unm.edu [64.106.20.39]) by mail.cs.unm.edu (Postfix) with ESMTP id 5A58EE415F; Tue, 30 Oct 2007 12:49:57 -0600 (MDT) From: "William D. Neumann" To: Edgar Friendly , Brian Hurt Cc: caml-list@inria.fr, Chung-chieh Shan Subject: Re: [Caml-list] Re: Which syntax to teach ? Date: Tue, 30 Oct 2007 13:50:17 -0500 Message-Id: <20071030183849.M55764@cs.unm.edu> In-Reply-To: <47276500.3050501@gmail.com> References: <1193225773.3612.27.camel@Blefuscu> <471F7F7B.9040905@fmf.uni-lj.si> <666572260710241205x19edbd4ar840811b1d7a7315f@mail.gmail.com> <5i2kv4-hmj.ln1@mantle.rutgers.edu> <47275E10.4070705@janestcapital.com> <47276500.3050501@gmail.com> X-Mailer: Open WebMail 2.50 20050106 X-OriginatingIP: 205.175.225.22 (wneumann) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.unm.edu X-Miltered: at discorde with ID 47277CD7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 functor:01 hofs:01 functors:01 ocaml:01 functor:01 edgar:98 wrote:01 caml-list:01 functions:01 modules:02 neumann:02 neumann:02 seems:03 module:03 On Tue, 30 Oct 2007 12:08:16 -0500, Edgar Friendly wrote > That's more or less how I think of them. Functions can be written with > "holes" to fill in with their parameters. In the same way, modules can > have these "empty puzzle-spaces" that, once you fit the right kind of > puzzle piece (module of the right type), you can plug it in (apply > the functor) to get a full module. Unfortunately, on top of what one sees with HOFs, functors have a bit more baggage associated with learning how to use them effectively. For one thing, the language is just different enough from the rest of OCaml to be a nuicance. And all of the extra bits needed to get the types to play nicely can really be hard to get a hold of (making types work as expected/desired seems to account for ~90% of the functor related questions to the mailing lists), and there's very little written up about it available for people to look at; section 2.4 of the manual only goes so far. -- William D. Neumann