From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 4C916BC57 for ; Fri, 8 Oct 2010 20:14:04 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYBAEf8rkzRVdivkGdsb2JhbACiOQgVAQEBAQkJDAcRAx+iZYtghneJBAEBAwWFQgSEUYVviQ8 X-IronPort-AV: E=Sophos;i="4.57,304,1283724000"; d="scan'208";a="60802692" Received: from mail-qy0-f175.google.com ([209.85.216.175]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Oct 2010 20:14:03 +0200 Received: by qyk30 with SMTP id 30so274864qyk.6 for ; Fri, 08 Oct 2010 11:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=eeLJkQ3ZnZ0X1So40tzGj0K+qaPa1Q6wzQ5YE2WnUXk=; b=ln7q942dsnDYO0AS0CMlO7x9xDbo9mD24qSEXY2ljL5SVHu7MSEmpDG1sXU77cEiyU eqhNYD8N8QkSrTJ/05sPuIJuGuWiQ42MrLvQWz4zhUdrbDysDmPsvF1mRbSW9upzWzmn ypwI5WzyKW6IRdAyZaSdB/Tie68rYNwMY0te8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=R0Z+k7FwuA3/Sp3RDjwfCUnb563DtXBZNrZ5G7Hbtydgaho2E/51u3zbZfux6vr5DM y42yRANBhAWp496CX3QLKLiMWMSJyGJiqpLwLKRdH4N5F4UvnBMgGAs4jxQyF9WzSPId J8gDmRDhBsgg7v84Q+PEV9gzmJcD8qnPr8bts= Received: by 10.224.88.103 with SMTP id z39mr1798054qal.43.1286561629081; Fri, 08 Oct 2010 11:13:49 -0700 (PDT) MIME-Version: 1.0 Sender: jake.donham@gmail.com Received: by 10.229.187.83 with HTTP; Fri, 8 Oct 2010 11:13:28 -0700 (PDT) In-Reply-To: References: From: Jake Donham Date: Fri, 8 Oct 2010 11:13:28 -0700 X-Google-Sender-Auth: a1dFjihJOwDEg7b7s2T7AnShlyU Message-ID: Subject: Re: [Caml-list] Type constraint to explain that a polymorphic variants is included into another To: Sylvain Le Gall Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; variants:01 le-gall:01 subtype:01 subtyping:01 functor:01 polymorphic:01 wrote:01 abstract:01 compile:01 caml-list:01 constraint:01 explicitly:02 seems:03 module:03 fri:05 On Fri, Oct 8, 2010 at 10:13 AM, Sylvain Le Gall wrote: > This code doesn't compile because I see no way to explain that F.kind is > included into plugin_kind. As you have written it, F.kind is of course completely abstract. I am not sure where you need F.kind to be a strict subtype of plugin_kind, but you could say type kind = plugin_kind (this seems a bit useless however). I don't think there is a way to use subtyping implicitly when applying a functor, but you can always do it explicitly by interposing a module of signature PLUGIN_FAMILY which embeds the specific kind in plugin_kind and passes the other components through. You could also have a general and a specific type in the plugin signature, and use the general one for general operations (e.g. help) but the specific one wherever that is needed. I am not sure I understand what you're trying to achieve however. Jake