caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <yallop@gmail.com>
To: Hongbo Zhang <hzhang295@bloomberg.net>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] typing question: universal type variable in class type
Date: Fri, 24 Jun 2016 19:55:55 +0100	[thread overview]
Message-ID: <CAAxsn=EKMzp_jax9oFVL+z3xqe5vF6_kWh+ikMyoneXOrYX-uA@mail.gmail.com> (raw)
In-Reply-To: <576D7A6E012D045A003906FD_0_112375@p057>

On 24 June 2016 at 19:22, Hongbo Zhang (BLOOMBERG/ 731 LEX)
<hzhang295@bloomberg.net> wrote:
> When we wrote bindings for promise, we want to express things (simplified )
> like below:
>
> class type ['b] promise = object
> method then_ : 'a . ('b -> 'a promise) -> 'a promise
> end
>
> It is not expressible in OCaml, The universal type variable 'a can not be
> generalized, I tried this too:
>
> type 'b promise = < then_ : 'a . ('b -> 'a u) -> 'a u >
>
> It does not work either, thanks -- Hongbo

You might find something useful in this thread:

   https://sympa.inria.fr/sympa/arc/caml-list/2015-10/msg00130.html

  reply	other threads:[~2016-06-24 18:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 18:22 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2016-06-24 18:55 ` Jeremy Yallop [this message]
2016-06-24 19:09 Hongbo Zhang (BLOOMBERG/ 731 LEX)

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='CAAxsn=EKMzp_jax9oFVL+z3xqe5vF6_kWh+ikMyoneXOrYX-uA@mail.gmail.com' \
    --to=yallop@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=hzhang295@bloomberg.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).