From: Dario Teixeira <darioteixeira@yahoo.com>
To: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Constraining abstract type to be of a given subtype
Date: Mon, 21 Feb 2011 10:42:43 -0800 (PST) [thread overview]
Message-ID: <982043.53335.qm@web111502.mail.gq1.yahoo.com> (raw)
In-Reply-To: <20110221170702.GJ25151@localhost>
Hi,
> But I think that you will not be able to do such type narrowing in a
> module interface / module interface fashion. At least not without an
> indication of covariance or contravariance. And even then, I'm not sure
> if that is possible.
Perhaps I am indeed pushing the module language beyond its design
intentions, but my requirement does not strike me as completely
unreasonable...
If I get rid of the constraint altogether, then I lose the guarantee that
kind_t is a subtype of Kind.t. But if I declare kind_t = Kind.t in the
signature FOO, then I lose the ability to declare particular instances
of FOO to be more *tightly* constrained than the generic Kind.t.
Any further ideas on how I may be able to have my cake and eat it too?
Cheers,
Dario Teixeira
next prev parent reply other threads:[~2011-02-21 18:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 15:56 Dario Teixeira
2011-02-21 17:07 ` Guillaume Yziquel
2011-02-21 18:42 ` Dario Teixeira [this message]
2011-02-21 19:26 ` Guillaume Yziquel
2011-02-21 19:39 ` Daniel Bünzli
2011-02-21 20:22 ` Dario Teixeira
2011-02-21 20:59 ` Daniel Bünzli
2011-02-21 21:31 ` Daniel Bünzli
2011-02-21 21:49 ` Daniel Bünzli
2011-02-22 16:15 ` Dario Teixeira
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=982043.53335.qm@web111502.mail.gq1.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@inria.fr \
--cc=guillaume.yziquel@citycable.ch \
/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