caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andres Varon <avaron@gmail.com>
To: skaller <skaller@users.sourceforge.net>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Polymorphic variants problem
Date: Sat, 2 Sep 2006 21:12:16 -0400	[thread overview]
Message-ID: <23AFCAC0-88AD-4FD3-85D3-1F37798DF59B@gmail.com> (raw)
In-Reply-To: <1157244509.12057.29.camel@rosella.wigram>

>
> Now, I just tried to use my super term union, but I ran
> into a problem. It looks like a fault in type inference,
> something like this:
>
> let f (x:[`A|`B]) = ..
> let g (x:[`A]) = ..
> ..
> fun x ->
>    f x;
>    g x;
>    ..
>
You have to define it as follows:

let f (x : [< `A | `B ]) = ..
let g (x : [`A]) =

to let the compiler know that the argument of f could be refined  
further.


      reply	other threads:[~2006-09-03  1:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-01 17:31 Polymorphic variants question David Allsopp
2006-09-01 18:33 ` Chris King
2006-09-01 19:00   ` [Caml-list] " skaller
2006-09-01 19:57     ` David Allsopp
2006-09-01 20:40       ` Jacques Carette
2006-09-01 18:40 ` [Caml-list] " Olivier Andrieu
2006-09-01 19:26 ` Jon Harrop
2006-09-01 19:29 ` skaller
2006-09-01 20:49   ` Andres Varon
2006-09-02 11:16     ` Jacques Garrigue
2006-09-03  1:22       ` Andres Varon
2006-09-03  9:08         ` Jacques Garrigue
2006-09-03 15:00           ` Andres Varon
2006-09-03 23:18             ` Jacques Garrigue
2006-09-03  0:48   ` [Caml-list] Polymorphic variants problem skaller
2006-09-03  1:12     ` Andres Varon [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=23AFCAC0-88AD-4FD3-85D3-1F37798DF59B@gmail.com \
    --to=avaron@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /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).