From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id 136815D4 for ; Sat, 18 Apr 2020 07:36:32 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.72,398,1580770800"; d="scan'208,217";a="445706195" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 18 Apr 2020 09:36:31 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id E06927F467; Sat, 18 Apr 2020 09:36:31 +0200 (CEST) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 16B6C7EEDF for ; Sat, 18 Apr 2020 09:36:29 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-qk1-f174.google.com IronPort-PHdr: =?us-ascii?q?9a23=3AIdxu3BHopzaKzg5YzeklGp1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ75p86wAkXT6L1XgUPTWs2DsrQf1LqQ7viocFdDyKjCmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWapAQfERTnNAdz?= =?us-ascii?q?Ov+9WsuL15z2hKiO/MjwbgNJjzq8KZppJRT++QzKv8g+gJAkLa0xw13AqT1KY7?= =?us-ascii?q?IF63lvIAe8lhzm58q0tKVo8ylKtuhpo8FJW7/7cqB+VrdYAS4rKUg64cTqsV/I?= =?us-ascii?q?Sg7ZtShUaXkfjhcdW1uN1xr9RJqk93Ki7rMgihnfBtX/SPUPYRrn76pvT0W22i?= =?us-ascii?q?IONjp86WKOz8Ip0/4drxWmqBhyhYXTZdPNbassTubmZdofAFF5cINUXi1FDJm7?= =?us-ascii?q?atJWXeUENOdc6YL6oglX9EfsNUyXHOrqjwRwqDrux6RjirYuFAjH2EorGNdc6H?= =?us-ascii?q?k=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BoBQAOrZpef67eVdFmDg8BAQEJAREFB?= =?us-ascii?q?QGBe4QcKoQdgRyCXosCghGKA3WFDIljgWcKAQMBDC8EAQGERAKCDxwHAQQ0EwI?= =?us-ascii?q?QAQEFAQEBAgECAwQBEwEBCQsLCCeFXwyCOwUBIwEGgn0KAQEBAgESER0BGx0BA?= =?us-ascii?q?wELBgUDAQc3AgIiAREBBQEcBhMIGoVPAQMOIKJkgQQ9iyiBFQUBF4MBBYR2Chk?= =?us-ascii?q?nDWIDgTQCBxKBJow5D4FMP4FHglo+hBSDTIJfBJdUmhwHgkd9BJZiHZw/rGQPI?= =?us-ascii?q?4FGgXkzGiNQMYI4UBgNkViDc4oYP0IwjV2BVAEB?= X-IPAS-Result: =?us-ascii?q?A0BoBQAOrZpef67eVdFmDg8BAQEJAREFBQGBe4QcKoQdgRy?= =?us-ascii?q?CXosCghGKA3WFDIljgWcKAQMBDC8EAQGERAKCDxwHAQQ0EwIQAQEFAQEBAgECA?= =?us-ascii?q?wQBEwEBCQsLCCeFXwyCOwUBIwEGgn0KAQEBAgESER0BGx0BAwELBgUDAQc3AgI?= =?us-ascii?q?iAREBBQEcBhMIGoVPAQMOIKJkgQQ9iyiBFQUBF4MBBYR2ChknDWIDgTQCBxKBJ?= =?us-ascii?q?ow5D4FMP4FHglo+hBSDTIJfBJdUmhwHgkd9BJZiHZw/rGQPI4FGgXkzGiNQMYI?= =?us-ascii?q?4UBgNkViDc4oYP0IwjV2BVAEB?= X-IronPort-AV: E=Sophos;i="5.72,398,1580770800"; d="scan'208,217";a="346310917" X-MGA-submission: =?us-ascii?q?MDF53oaGBPSfkRVBNBRzm2QlunmAcL+DvDm8wn?= =?us-ascii?q?ZSBT5Iil6K4h/RjKKw1p1t2DJ3HYGW3F+60AD6Pj2eI1IDiGlbp3mb+9?= =?us-ascii?q?jSSYzv2Ltz4OsHHqf7j9gji0xgPW/XX0W8iC0N6Ej9mnrND2bHI5w6YS?= =?us-ascii?q?u3GZ3KvNNNcUcTgoL3MyixVw=3D=3D?= Received: from mail-qk1-f174.google.com ([209.85.222.174]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 18 Apr 2020 09:36:27 +0200 Received: by mail-qk1-f174.google.com with SMTP id t3so5046260qkg.1 for ; Sat, 18 Apr 2020 00:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4+7QqybPLaEQaExEswTLBAgtRnjPqy8S/yV05t229x8=; b=CwfKFhD+bbiU9Tg2yGPGDCUPqJ8tWrO929kp8PP8vqOFAmkHMFziaIBeozy8wf+RrM Qyr/6KsrAzlBToEVrUsvLXHrGe1us277s3luQLH69lC1jwZ97Mnwe1vQfCXNeL6DNAZ6 JULOLCUPIsxuFnjsaBtZ+PvjnWwqJ26cIC15P8MuOMAQYRoO0Z10xqBbK6mXLAcuwFTM wYPlTQiauFEOVfbObT2KQ+JfVDrzkQc5tl1QrD4Oq8iaLuIkT/iLDCt5aZZMg+DCL/va rQydd2UPgmzXbC2hyea+oSiS8aubMG/+VzqPszQ1u4uVVyEGNONngIjzqx6XY3Os0kZf GZEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4+7QqybPLaEQaExEswTLBAgtRnjPqy8S/yV05t229x8=; b=WOCDjCjrUCUIfJ6b+ipOKYgT2ZnszGh4QiTR4HKAM6+OGjF6+8O1OMeL1NkCu82OE9 Y9sZo5R2HCmQMzHc3lLcvFm3PyNkZKxYYhmgvTkqylXEQCl41XwVsHKqk2KHN1ARNMyO 1FeW86nGxMCd3LyrK5Zb7bIpyTVi025Zh73mxDsfXf9ocIIBZnNEVSawMfeOVIFpZh4F gf1QgQg64QeYFP2GyORyH+UqFSpNW24svBTzhmMKHucyrKje1ctjvwHNN93M2BMMYZlE 5KYmO/FhLUdEVTcBKWoyjN1AqAXKir/gzkw7KKz/ZrqHBZqYrunO8KezA/xZ3ltlB/wN fAqA== X-Gm-Message-State: AGi0PuZHkKqUxLu2CLYXqQJv2+U2xWA7PB8eSFcJSxHygHUmPgYjjVHg kK9FTogGV3V4BMLh4OyJsQ6sLcIa4IW8t4G9ESpR9Ywj X-Google-Smtp-Source: APiQypK3Pzcfl0xK2P0yb+W3zK6pW/9N6soSIuczafOvji/+vBLh5RLvinZfMXUO6I9Mos3yA+/lP+GN97TUG8VC6M4= X-Received: by 2002:ae9:dfc2:: with SMTP id t185mr6917039qkf.20.1587195386492; Sat, 18 Apr 2020 00:36:26 -0700 (PDT) MIME-Version: 1.0 References: <20200418022319.GA75735@pllab.is.ocha.ac.jp> In-Reply-To: <20200418022319.GA75735@pllab.is.ocha.ac.jp> From: Gabriel Scherer Date: Sat, 18 Apr 2020 09:35:47 +0200 Message-ID: To: Kenichi Asai Cc: caml users Content-Type: multipart/alternative; boundary="000000000000337c4b05a38bb90e" Subject: Re: [Caml-list] Locally abstract parameterized types? Reply-To: Gabriel Scherer X-Loop: caml-list@inria.fr X-Sequence: 18103 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --000000000000337c4b05a38bb90e Content-Type: text/plain; charset="UTF-8" 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 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 > --000000000000337c4b05a38bb90e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Kenichi,

No, this is cu= rrently not supported. For this use-case you will have to use modules, typi= cally a functor (in some circumstances a first-class module parameter may w= ork 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 =3D ...

Can the t take parameters as in 'a t?=C2=A0 I want to have a locally abstract type that has type parameters.=C2=A0 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
--000000000000337c4b05a38bb90e--