From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3B7Md6W022763 for ; Mon, 11 Apr 2011 09:22:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIBANWrok3RVdi0kGdsb2JhbACmEQgUAQEBAQkJDQcUBCGIep04imiCI4NnMIhdAQEDBoVoBIF/i1mHKIIQOg X-IronPort-AV: E=Sophos;i="4.63,338,1299452400"; d="scan'208";a="80553358" Received: from mail-qy0-f180.google.com ([209.85.216.180]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 11 Apr 2011 09:21:52 +0200 Received: by qyk10 with SMTP id 10so4596777qyk.18 for ; Mon, 11 Apr 2011 00:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=iWEg75sdfhnxClDSoOGdhFjfbmc6Osvufv19n64hNYo=; b=m62pG+2yhoummyYta2b/oIPvvzDEI3wGJzCSdGC896U8NlPtrVJAku3+4rIzuKM5OU bKsaTK11fo058mk7A28L+5d8pKlbWT9e/bFgYoIkjIpX7i3TvCrGDahlN1NALc+V8+V3 ZE7qrD1GMFGXWWk0i6FtIrm/cw1/nJFg3/CQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Nopqe4niEkBd0zX+Pns/U6Oo5z/jN0fSze5qsk04yzMsUJpL/0IUHoJDAF5nDU+vpD 2hlYT1llqV7Lq3om34/WdHhB0LXENpcJEFhrpsXuvUCPwJ6CxXQXeRxQjm3AtzApDwB7 AsLjsp0t2qkdPTujh1j2AwVh2K+hgjS/7cYA0= MIME-Version: 1.0 Received: by 10.229.63.77 with SMTP id a13mr3752339qci.233.1302506510224; Mon, 11 Apr 2011 00:21:50 -0700 (PDT) Received: by 10.229.250.5 with HTTP; Mon, 11 Apr 2011 00:21:50 -0700 (PDT) In-Reply-To: References: <4D9E28D2.1050808@wp.pl> <1302212990.8429.1150.camel@thinkpad> <0F248A34-05CF-4640-B122-75C4CE7C2CD2@mpi-sws.org> <4D9EC172.1060205@lexifi.com> <4D9ECAF2.7070300@lexifi.com> <4D9EF86A.9040202@lexifi.com> Date: Mon, 11 Apr 2011 09:21:50 +0200 Message-ID: From: Julien Signoles To: Alain Frisch Cc: Jacques Garrigue , caml-list Content-Type: multipart/alternative; boundary=0016e652f448dc0c5804a09f6dc7 Subject: Re: [Caml-list] What is an applicative functor? --0016e652f448dc0c5804a09f6dc7 Content-Type: text/plain; charset=ISO-8859-1 2011/4/11 Julien Signoles > Hello Allain, > > 2011/4/8 Alain Frisch > >> On 04/08/2011 01:25 PM, Julien Signoles wrote: >> >>> 2) module F(X:...) = G(H(X)) >>> >>> Without applicative functors, we again get the error about parameter >>> elimination. But I see no workaround to eliminate it without changing >>> the signature of F. So IMHO that is a use case where applicative >>> functors are useful. >>> >> >> I'd be interested to see a full example for this case. >> > > Download sources of Frama-C here : > http://frama-c.com/download/frama-c-Carbon-20110201.tar.gz > The use case is in module State_builder : > > src/project/state_builder.ml: > (* ... *) > module Caml_weak_hashtbl(Data: Datatype.S) = > Weak_hashtbl(Weak.Make(Data))(Data) > (* ... *) > > Do you see any workaround to compile this code with -no-app-funct (and as > most as possible without changing API)? > Looking this case in details, there is actually one workaround. src/project/state_builder.ml: (* ... *) module Caml_weak_hashtbl(Data: Datatype.S)(Info: Info_with_size) = struct module W = Weak.Make(Data) include Weak_hashtbl(W)(Data)(Info) end (* ... *) There is still the issue with diamond import in libraries like mentionned by Andreas. Sorry for the noise, Julien --0016e652f448dc0c5804a09f6dc7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2011/4/11 Julien Signoles <julien.signoles@gmail.= com>
Hello Allain,

2011/4/8 = Alain Frisch <alain.frisch@lexifi.com>
<= div>
On 04/08/2011 01:25 PM, Julien Signoles wrote:
2) module F(X:...) =3D G(H(X))

Without applicative functors, we again get the error about parameter
elimination. But I see no workaround to eliminate it without changing
the signature of F. So IMHO that is a use case where applicative
functors are useful.

I'd be interested to see a full example for this case.
=

Download sources of Frama-C here : http:= //frama-c.com/download/frama-c-Carbon-20110201.tar.gz
The use case is in module State_builder :

src/project/state_builder.ml:
(* ... *)<= br>module Caml_weak_hashtbl(Data: Datatype.S) =3D Weak_hashtbl(Weak.Make(Da= ta))(Data)
(* ... *)

Do you see any workaround to compile this code with -no-app-funct (and = as most as possible without changing API)?

Looking this case in details, there is actually one workaround.

src/project/stat= e_builder.ml:
(* ... *)
module Caml_weak_hashtbl(Data: Datatype.S= )(Info: Info_with_size) =3D struct
=A0 module W =3D Weak.Make(Data) =A0 include Weak_hashtbl(W)(Data)(Info)
end
(* ... *)

There is still the issue with diamond import in libraries like me= ntionned by Andreas.

Sorry for the noise,
Julien
--0016e652f448dc0c5804a09f6dc7--