Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Stephane Glondu <steph@glondu.net>
To: Jacques GARRIGUE <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Union of polymorphic variants...
Date: Wed, 05 Dec 2007 16:59:11 +0100	[thread overview]
Message-ID: <4756CACF.5080008@glondu.net> (raw)
In-Reply-To: <20071205.111718.2004158852.garrigue@math.nagoya-u.ac.jp>

Jacques GARRIGUE a écrit :
> Nothing is "difficult". But not everything is well-defined...
> The question is where do we start, where do we stop.
> 
> type a = [`S of a | `Z]
> 
> should #a be (`S _ | `Z) or (`S (`S _ | `Z) | `Z) or ...?

OK, I grasp now the difficulty of the problem.

> Note that you can still build the types by hand
> 
> type 'a t = [`A of 'a]
> type b = [`B of bool]
> type c = [`C of char]
> type a = [b|c] t
> 
> let f = function
>     `A #b as x -> fb x
>   | `A #c as x -> fc x

I didn't know this trick.


Thanks,

-- 
Stéphane Glondu


      reply	other threads:[~2007-12-05 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04 12:38 Stephane Glondu
2007-12-04 13:57 ` [Caml-list] " Jacques Garrigue
2007-12-04 14:33   ` Stephane Glondu
2007-12-05  2:17     ` Jacques GARRIGUE
2007-12-05 15:59       ` Stephane Glondu [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=4756CACF.5080008@glondu.net \
    --to=steph@glondu.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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