From: Mikhail Mandrykin <mandrykin@ispras.ru>
To: Vincent Jacques <vincent@vincent-jacques.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Typing of recursive function with polymorphic variants
Date: Fri, 14 Apr 2017 21:47:09 +0300 [thread overview]
Message-ID: <3147640.9aH54fEQfF@molnar> (raw)
In-Reply-To: <2493165.Qrs57diDXJ@molnar>
On пятница, 14 апреля 2017 г. 21:11:52 MSK Mikhail Mandrykin wrote:
> the desired type ([< `A of 'a | `B ] as 'a) -> [> `B]
> val f2 : ([< `A of 'a | `B ] as 'a) -> [ `B ] = <fun>
Actually, one more polymorphic variable:
let rec f2 : 'a 'b. ([<`A of 'a | `B ] as 'a) -> ([>`B] as 'b)= function
| `A x -> f2 (f2 x)
| `B -> `B;;
val f2 : ([< `A of 'a | `B ] as 'a) -> [> `B ] = <fun>
--
Mikhail
next prev parent reply other threads:[~2017-04-14 18:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-14 15:30 Vincent Jacques
2017-04-14 18:11 ` Mikhail Mandrykin
2017-04-14 18:47 ` Mikhail Mandrykin [this message]
2017-04-15 8:23 ` Vincent Jacques
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=3147640.9aH54fEQfF@molnar \
--to=mandrykin@ispras.ru \
--cc=caml-list@inria.fr \
--cc=vincent@vincent-jacques.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