caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Kenichi Asai <asai@is.ocha.ac.jp>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Locally abstract parameterized types?
Date: Sat, 18 Apr 2020 09:35:47 +0200	[thread overview]
Message-ID: <CAPFanBHvrnTqq1q0Ony4yqGvZPr9odKw_orZoA5Lje6T_RDRCA@mail.gmail.com> (raw)
In-Reply-To: <20200418022319.GA75735@pllab.is.ocha.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

Dear Kenichi,

No, this is currently not supported. For this use-case you will have to use
modules, typically a functor (in some circumstances a first-class module
parameter may work as well, if the return type does not depend on the
parameter).

On Sat, Apr 18, 2020 at 4:24 AM Kenichi Asai <asai@is.ocha.ac.jp> wrote:

> OCaml allows locally abstract types:
>
> let f (type t) x = ...
>
> Can the t take parameters as in 'a t?  I want to have a locally
> abstract type that has type parameters.  The manual says the t in
> (type t) must be {typeconstr-name}+ which expands to a sequence of
> lowercase-ident, so probably this is not allowed...
>
> --
> Kenichi Asai
>

[-- Attachment #2: Type: text/html, Size: 1028 bytes --]

  reply	other threads:[~2020-04-18  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18  2:23 Kenichi Asai
2020-04-18  7:35 ` Gabriel Scherer [this message]
2020-04-18  9:47   ` Kenichi Asai
2020-04-18 10:01     ` Gabriel Scherer
2020-04-18 10:04     ` Jeremy Yallop
2020-04-18 11:00       ` Kenichi Asai

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=CAPFanBHvrnTqq1q0Ony4yqGvZPr9odKw_orZoA5Lje6T_RDRCA@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=asai@is.ocha.ac.jp \
    --cc=caml-list@inria.fr \
    /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).