caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jake Donham <jake@donham.org>
To: Sylvain Le Gall <sylvain@le-gall.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Type constraint to explain that a polymorphic variants is included into another
Date: Fri, 8 Oct 2010 11:13:28 -0700	[thread overview]
Message-ID: <AANLkTimE75FD_86jpd0wbEcrHp4vCHCS-pkDutfYHiW2@mail.gmail.com> (raw)
In-Reply-To: <slrniauk9n.fmh.sylvain@gallu.homelinux.org>

On Fri, Oct 8, 2010 at 10:13 AM, Sylvain Le Gall <sylvain@le-gall.net> 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


  reply	other threads:[~2010-10-08 18:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-08 17:13 Sylvain Le Gall
2010-10-08 18:13 ` Jake Donham [this message]
2010-10-08 22:10   ` Sylvain Le Gall
2010-10-08 20:09 ` [Caml-list] " Jacques Garrigue
2010-10-11  8:49   ` Sylvain Le Gall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimE75FD_86jpd0wbEcrHp4vCHCS-pkDutfYHiW2@mail.gmail.com \
    --to=jake@donham.org \
    --cc=caml-list@inria.fr \
    --cc=sylvain@le-gall.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).