From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p388idfa008640 for ; Fri, 8 Apr 2011 10:44:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAMDJnk3B/BfXkWdsb2JhbACmJQEBAQEJCwsHFAMiwEuFbQSNToNqiR8 X-IronPort-AV: E=Sophos;i="4.63,322,1299452400"; d="scan'208";a="105243311" Received: from msa06.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.215]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Apr 2011 10:44:34 +0200 Received: from [192.168.1.63] ([83.204.229.18]) by mwinf5d22 with ME id UwkZ1g00x0QTpRf03wkZQG; Fri, 08 Apr 2011 10:44:34 +0200 Message-ID: <4D9ECAF2.7070300@lexifi.com> Date: Fri, 08 Apr 2011 10:44:34 +0200 From: Alain Frisch Organization: LexiFi User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Jacques Garrigue CC: caml-list References: <4D9E28D2.1050808@wp.pl> <1302212990.8429.1150.camel@thinkpad> <0F248A34-05CF-4640-B122-75C4CE7C2CD2@mpi-sws.org> <4D9EC172.1060205@lexifi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] What is an applicative functor? On 04/08/2011 10:20 AM, Jacques Garrigue wrote: > Applicative functors have other advantages, like the fact you can refer to a > type produced by a functor without having really applied it. > > For instance think of the following functor definition > > module F(O : Set.OrderedType)(S : sig type t = Set.Make(O).t val union : t -> t -> t end) = ... > > If you want to do the same thing with generative functors, I believe you have to > pass the result of Set.Make(O) around physically. > I do think this is a significant weakness. I can imagine uses for: module F(O : Set.OrderedType)(S : Set.S with type elt = O.t) = but I don't see a real-life case where one would want functor F to know that the type S.t was really produced by applying Set.Make. Do you have a specific example in mind? Alain