caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Edgar Friendly <thelema314@gmail.com>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list@inria.fr, oleg@okmij.org
Subject: Re: [Caml-list] GADTs in OCaml
Date: Mon, 13 Jul 2009 07:45:42 -0500	[thread overview]
Message-ID: <4A5B2C76.9060603@gmail.com> (raw)
In-Reply-To: <468067.61779.qm@web111510.mail.gq1.yahoo.com>

Dario Teixeira wrote:
> Hi,
> 
>> We present a simple, pure, magic-free implementation of a form of
>> GADTs in OCaml that is sufficient for the common applications of GADTs
>> such as data structures with embedded invariants, typed printf/scanf,
>> tagless interpreters. (...)
> 
> Very interesting -- clever, yet so simple!  But note that as far as the
> link-nodes-shall-not-be-ancestors-of-their-kind problem is concerned, there
> is one problem with the presented implementation.  Consider the following
> declarations:
> 
> let t1 = text "ola"
> let t2 = href "http"
> let t3 = bold [t1; t2]
> let t4 = mref "http" [t1]
> 
> This causes an error upon t4.  The reason is that because of t3, t1 was
> unified as "node_link node_t", whereas t4 requires it to be "node_nolink node_t".  I think the solution is to revert to using polymorphic variants
> for the phantom type, and take advantage of their open-ended nature.
> (Though I'm guessing some extra massaging will be required -- it's Sunday
> and I don't have much time to look into this).
> 
> Anyway, perhaps the Batteries folks will consider including both versions
> of the Eq module?  It will certainly prove useful for many people. (Am I
> correct in assuming you are releasing the code into the public domain or
> at least some open-source friendly license?)
> 
> Best regards,
> Dario Teixeira
> 
> 

Absolutely - this kind of thing seems perfect for batteries included.  I
still need to wrap my head around exactly how to use it, but I'm very
happy to have more flexible types available.

E


      reply	other threads:[~2009-07-13 12:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11  3:05 oleg
2009-07-12 12:56 ` [Caml-list] " Dario Teixeira
2009-07-13 12:45   ` Edgar Friendly [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=4A5B2C76.9060603@gmail.com \
    --to=thelema314@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=darioteixeira@yahoo.com \
    --cc=oleg@okmij.org \
    /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).