From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id C33947EE99 for ; Tue, 21 Jan 2014 14:32:26 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lpw25@cam.ac.uk) identity=pra; client-ip=131.111.8.133; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="lpw25@cam.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lpw25@cam.ac.uk) identity=mailfrom; client-ip=131.111.8.133; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="lpw25@cam.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@ppsw-33.csi.cam.ac.uk) identity=helo; client-ip=131.111.8.133; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="postmaster@ppsw-33.csi.cam.ac.uk"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMBACN23lKDbwiFnGdsb2JhbABZwAeBDhYOAQEBAQEICwkJFCiCJQEBAQMBJxMaJQULCyElDwEESYgQCATCPoR/FxaOaQeEOAStZw X-IPAS-Result: AmMBACN23lKDbwiFnGdsb2JhbABZwAeBDhYOAQEBAQEICwkJFCiCJQEBAQMBJxMaJQULCyElDwEESYgQCATCPoR/FxaOaQeEOAStZw X-IronPort-AV: E=Sophos;i="4.95,696,1384297200"; d="scan'208";a="45573756" Received: from ppsw-33.csi.cam.ac.uk ([131.111.8.133]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Jan 2014 14:32:26 +0100 X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from host81-154-221-63.range81-154.btcentralplus.com ([81.154.221.63]:55629 helo=netbook) by ppsw-33.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:lpw25) (TLSv1.2:DHE-RSA-AES128-SHA:128) id 1W5bRJ-00016r-hk (Exim 4.82_3-c0e5623) (return-path ); Tue, 21 Jan 2014 13:32:25 +0000 From: Leo White To: SEROT Jocelyn Cc: OCaML Mailing List References: <87ppnm5q2x.fsf@study.localdomain> <20140121120954.Horde.QQKslk0F5ldpqozcxKyq3g1@wmail.univ-bpclermont.fr> X-Face: "XWxb[u_Z\PA_Y?9@|IA!!+jTb(/290-*ea/Un$I0B98.$n%eL.;2w*,z]WR#T:,p[ NBd++M7l]#7zj7!{~iw $W-"/=|dVjhT[D{4~gE}gK<2`.6fs!;uqqud]vs2N/3^m7{aS1V, Date: Tue, 21 Jan 2014 13:32:23 +0000 In-Reply-To: <20140121120954.Horde.QQKslk0F5ldpqozcxKyq3g1@wmail.univ-bpclermont.fr> (SEROT Jocelyn's message of "Tue, 21 Jan 2014 12:09:54 +0100") Message-ID: <86lhy98nq0.fsf@cam.ac.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Caml-list] Question on functors (again...) > Unfortunately, this is not possible since the ELT signature is actually more complex than just 'sig type t end'. > To illustrate this, without showing the original code (which, as you guessed it, has some extra and maybe unrelated > complexity), i've tried to reuse your example, by simply changing You can still add the constraint to the SET type: module type SET = sig type t type elt module Elt : ELT with type t = elt val choose: t -> elt val singleton: elt -> t val string_of: t -> string end You should also remove the equivalent constraint from the `Make` functor: module Make (E : ELT) : SET with type elt = E.t = struct type elt = E.t type t = elt list module Elt = E let choose s = List.hd s let singleton e = [e] let string_of s = "{" ^ E.string_of (choose s) ^ "}" end Regards, Leo