caml-list - the Caml user's mailing list
 help / Atom feed
From: Christophe Troestler <Christophe.Troestler@umons.ac.be>
To: Christopher Zimmermann <christopher@gmerlin.de>
Cc: <caml-list@inria.fr>
Subject: Re: [Caml-list] How to narrow polymorphic variant phantom types
Date: Sun, 13 Jan 2019 11:10:02 +0100
Message-ID: <87sgxw3m2t.fsf@poincare.umons.ac.be> (raw)
In-Reply-To: <20190113084919.5cfaa055@mortimer.gmerlin.de>


On 13 January 2019 at 08:49 CET, Christopher Zimmermann wrote:
>
> […] I'd like to express a typing like
> val dup : 'a perm -> [< `Read | `Write > 'a] desc -> 'a desc
> but a type variable inside the polymorphic variant type is not allowed.

How about

    val dup : ([< `Read | `Write ] as 'a) perm -> 'a desc -> 'a desc

?

Cheers,
C.

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list https://inbox.ocaml.org/caml-list
Forum: https://discuss.ocaml.org/
Bug reports: http://caml.inria.fr/bin/caml-bugs

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-13  7:49 Christopher Zimmermann
2019-01-13 10:10 ` Christophe Troestler [this message]

Reply instructions:

You may reply publically 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=87sgxw3m2t.fsf@poincare.umons.ac.be \
    --to=christophe.troestler@umons.ac.be \
    --cc=caml-list@inria.fr \
    --cc=christopher@gmerlin.de \
    /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

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox