From: Dario Teixeira <darioteixeira@yahoo.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Constraining abstract type to be of a given subtype
Date: Tue, 22 Feb 2011 08:15:51 -0800 (PST) [thread overview]
Message-ID: <991458.43212.qm@web111507.mail.gq1.yahoo.com> (raw)
In-Reply-To: <AANLkTim=oKFE-p75Yv_6oDf+0tO9+CAqc1EcufGr0yuO@mail.gmail.com>
Hi Daniel,
> Ok last message I promise.
No problem -- I appreciate the help, thanks!
> I don't know exactly what you want but you may prefer the following
> FOO (see the signature of kind_to_kind) :
I decided to take a step back and forgo the constraint. That is, I'm
making the type really abstract, even if in practice all the concrete
implementations of signature FOO will have a kind_t that is a subtype
of Kind.t.
Though it's nice to use the type system to ensure correctness by
construction, in situations (like this one) where one is pushing
against the limits of the type system, the solution can end up
being too cumbersome to use in practice. Cf, per example, the
pre-3.13 type system tricks to encode GADTs that have been presented
in this list: though brilliant, they haven't gained that much
traction in actual usage because of the associated overhead.
Best regards,
Dario Teixeira
prev parent reply other threads:[~2011-02-22 16:15 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
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 [this message]
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=991458.43212.qm@web111507.mail.gq1.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@inria.fr \
--cc=daniel.buenzli@erratique.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