caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <yallop@gmail.com>
To: Caml List <caml-list@inria.fr>
Cc: Goswin von Brederlow <goswin-v-b@web.de>
Subject: Re: [Caml-list] GADTs and associative container
Date: Thu, 11 Jul 2013 15:28:40 +0100	[thread overview]
Message-ID: <CAAxsn=GFfbspEc0DzecMXs_9ozKM=uiNUtef94EuX1PgCRVypA@mail.gmail.com> (raw)
In-Reply-To: <20130711141735.GC26521@frosties>

On 11 July 2013 15:17, Goswin von Brederlow <goswin-v-b@web.de> wrote:
> Can't GADT using functions be passed as arguments without stuffing
> them into a class object?

Yes.  There are several ways to do so.  The code in the thread that
Alain mentioned uses what is probably the best approach in this case.

> This boxing and unboxing feels wrong. It's wastefull because you
> create dummy objects for the Pair. The key part is a repetition of
> what is already the key in the table. Only the value is actualy
> new information.
[...]
> So I still wonder if one couldn't build a (better) associative
> container from scratch that supports GADTs to describe the type
> dependency between the key and the value without that custom unpack
> function. How much of the above is just there to make it work with the
> standard polymorphic Hahstbl.t?

These issues are also discussed in the thread that Alain mentioned.

      reply	other threads:[~2013-07-11 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 20:43 Goswin von Brederlow
2013-07-09 20:52 ` Lukasz Stafiniak
2013-07-10  9:52   ` Leo White
2013-07-10 10:16   ` Alain Frisch
2013-07-10  2:22 ` Jeremy Yallop
2013-07-11 14:17   ` Goswin von Brederlow
2013-07-11 14:28     ` Jeremy Yallop [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='CAAxsn=GFfbspEc0DzecMXs_9ozKM=uiNUtef94EuX1PgCRVypA@mail.gmail.com' \
    --to=yallop@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=goswin-v-b@web.de \
    /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).