caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: brogoff <brogoff@speakeasy.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Comparing two things of any two types, in pure OCaml
Date: Wed, 13 Sep 2006 21:36:36 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0609132125410.26512@shell2.speakeasy.net> (raw)
In-Reply-To: <20060909.161349.09849160.garrigue@math.nagoya-u.ac.jp>

On Sat, 9 Sep 2006, Jacques Garrigue wrote:
> > Jacques Garrigue suggested using Obj.repr. He also wrote ``Type
> > theoretician answer: What you would need to do that transparently
> > inside the type system is generic functions with dynamics.'' and
> > mentioned GADT.
>
> Small comment: By transparently I meant "without any type
> annotation". Then I gave a solution using normal datatypes for
> annotations, and polymorphic methods, and just mentioned that GADTs
> were not useful in this case. Note that my solution cannot directly
> use polymorphic variants, it uses non-regular types, and
> polymorphic variants have to be regular.

Is that to make type inference tractable? If so, any ideas on what
amount of annotation would be needed to get around this?

> This said, I love polymorphic variants anyway...

I like them a lot, and I often wish there was a dual notion of polymorphic
records in Caml as well. But now I wonder about the non-regular types issue
you bring up; I guess it means that you need plain old sum types too
if you wish to use them.

-- Brian


      parent reply	other threads:[~2006-09-14  4:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-09  3:11 oleg
2006-09-09  7:13 ` [Caml-list] " Jacques Garrigue
2006-09-13  9:14   ` [Caml-list] Comparing two things of any two types, in pure oleg
2006-09-16 18:53     ` Improper generic equality in Caml (Rossberg's SML vs Caml) Diego Olivier Fernandez Pons
2006-09-16 20:58       ` [Caml-list] " Jacques Garrigue
2006-09-17  5:08       ` rossberg
2006-09-17  9:45         ` skaller
2006-09-17 12:43           ` rossberg
2006-09-14  4:36   ` brogoff [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=Pine.LNX.4.58.0609132125410.26512@shell2.speakeasy.net \
    --to=brogoff@speakeasy.net \
    --cc=caml-list@inria.fr \
    /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).