From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 0E14D7EE79 for ; Mon, 16 May 2016 21:04:32 +0200 (CEST) IronPort-PHdr: 9a23:VPBtdxFF9KokwWYwDQXwap1GYnF86YWxBRYc798ds5kLTJ75r8ywAkXT6L1XgUPTWs2DsrQf27uQ6f6rADdYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7H0ocOYOl4QzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IeezAcq85Vb1VCig9eyBwvZWz9EqLcQzayWERXWIMg1JtCgzI5xHzFsP+tyL+u+F90QGVOMT3SfY/XjH0vIlxTxq9uSAbPjtx2mjNjMthxPZKpw6oohZ22YjTcamaMfN/euXWetZMFjkJZdpYSyEUWtD0VIAIFedUeL8A94Q= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=yotambarnoy@gmail.com; spf=Pass smtp.mailfrom=yotambarnoy@gmail.com; spf=None smtp.helo=postmaster@mail-yw0-f169.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.161.169; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.161.169 as permitted sender) identity=mailfrom; client-ip=209.85.161.169; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yw0-f169.google.com) identity=helo; client-ip=209.85.161.169; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yw0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CNAQCLGDpXj6mhVdFchAx+BrIPh2aBdiSFbQKBJwc5EwEBAQEBAQEBEQEBAQEHCwsJIS+CLYIVAQEBAwESEQQZARQHDw4BAwELBgMCCwMKKgICIQEBEQEFARwGEwkZh3IBAw8IDpIGj0KBMT4xizuBaoJYBYdWChknDVKDVQEBAQEBAQEBAQEBAQEBAQEBAQEBARQCBhCGFYRNgkOCCCGCU4JZBYd+j3gxhX6GJwOBdoI3jGKHXIYnEh6BDg8TA4I2HoFxIDIBiAUBAQE X-IPAS-Result: A0CNAQCLGDpXj6mhVdFchAx+BrIPh2aBdiSFbQKBJwc5EwEBAQEBAQEBEQEBAQEHCwsJIS+CLYIVAQEBAwESEQQZARQHDw4BAwELBgMCCwMKKgICIQEBEQEFARwGEwkZh3IBAw8IDpIGj0KBMT4xizuBaoJYBYdWChknDVKDVQEBAQEBAQEBAQEBAQEBAQEBAQEBARQCBhCGFYRNgkOCCCGCU4JZBYd+j3gxhX6GJwOBdoI3jGKHXIYnEh6BDg8TA4I2HoFxIDIBiAUBAQE X-IronPort-AV: E=Sophos;i="5.26,627,1459807200"; d="scan'208,217";a="177957256" Received: from mail-yw0-f169.google.com ([209.85.161.169]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 16 May 2016 21:04:30 +0200 Received: by mail-yw0-f169.google.com with SMTP id j74so171386569ywg.1 for ; Mon, 16 May 2016 12:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RfnzNTJXkgwZdUaosGxsk5LOE2urUy8O+0e/EdaQ7Jw=; b=Yp7gV/4wpNgd9uTrfQ4rIO+mu70rzxUF0iqVuSmSQaBy1fbfRzZXpOIs0eowTqK10q Mlp/dMoi5yZPt5U1hniU81RoiUR2A0f9QfcUWjXHGXmTx/9zc2W/KaXvfjax9IzFlMzQ PvZP012M6AhLjpc5pK9FUtTwnHFHc4Pqd/Q5tedBjSPFlMdI7Z23dMT6m+ULJU2LUXfV sfHHDyfszfZiFA0Joo34HbjBuhE6k4Sx6hfGem/DQvTuqde66rZd8NhwCFGLj9ahHVv6 Z2SOUO/P8dCUcZm20qkX16BOLj+0Sy+ws5bp2PDqlXN31iC7VvX1x/YpnA+peZaXHujw 6rwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RfnzNTJXkgwZdUaosGxsk5LOE2urUy8O+0e/EdaQ7Jw=; b=FFVldQwKZAJFrJjpZn8paRSmtAT+pOeKG1qrFgLk67vE1+Gn3bmTDeZfG0jkluuAv6 wrZDIIpHnwYqQNidHVhogi8qhrcCRwuIw42M1IET46+KvG9VG1a/3Nb4PRPUJxbVTCip W1Jqd0ZYPB/MIwYxjgUDBUyLW6gmlr4GKbgnqhtA0UwN+g6Dk7FRBUF3KVlrNJn7/u09 OlC6gPJbjhYCBNsNJIrxocVtOY2b2YIDiycQzTF/HF+OsSnVesDjW0c5qLDRlnT0EAJd RM2GHC4FGgU2h0JBND4LZnrQTjFXMx6RIBpObGOX7XgrtKsaqTNneyPHrSFx0lG9r/bD HNeA== X-Gm-Message-State: AOPr4FWUln5wEO7IVybOZD0mkbzAHpaGPrHqBenD42F9yVKiJOh5mWzScnEmn+uVtqO/er7UO0wOgC/lEndwoQ== X-Received: by 10.129.88.135 with SMTP id m129mr14821997ywb.204.1463425469547; Mon, 16 May 2016 12:04:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.209.143 with HTTP; Mon, 16 May 2016 12:04:10 -0700 (PDT) In-Reply-To: References: <1463412482-sup-8520@hennequin-xps> <1463417600-sup-2106@hennequin-xps> <1463419945.3467.32.camel@e130.lan.sumadev.de> From: Yotam Barnoy Date: Mon, 16 May 2016 15:04:10 -0400 Message-ID: To: Gregory Malecha Cc: Gerd Stolpmann , Guillaume Hennequin , caml users Content-Type: multipart/alternative; boundary=001a11492ebe448bb40532fa4be0 Subject: Re: [Caml-list] issue with polymorphism --001a11492ebe448bb40532fa4be0 Content-Type: text/plain; charset=UTF-8 Right, but they can't be inferred on objects and records either, and yet they're allowed there... so what was the rationale? On Mon, May 16, 2016 at 2:53 PM, Gregory Malecha wrote: > There may other reasons as well, e.g. performance and compilability, but > the main reason that I know is that inferring these types is difficult > (undecideable in general). For a point of comparison, GHC supports types > like this, but only when they are explicitly written. > > On Mon, May 16, 2016, 11:50 AM Yotam Barnoy wrote: > >> Paging the type experts -- is there a concrete reason why we disallow >> writing this type directly? >> >> On Mon, May 16, 2016 at 1:32 PM, Gerd Stolpmann >> wrote: >> >>> Am Montag, den 16.05.2016, 17:55 +0100 schrieb Guillaume Hennequin: >>> > Thanks all for your prompt answers; >>> > >>> > > See the FAQ entry, "How to write a function with polymorphic >>> arguments?" >>> > > >>> https://ocaml.org/learn/faq.html#Howtowriteafunctionwithpolymorphicarguments >>> > >>> > this page explains how to do it with records or objects, but ends with >>> a >>> > mysterious "FIXME: a direct way now exists". Does anyone know what >>> this might >>> > refer to? >>> >>> What you would need is >>> >>> let print_both : ('a . 'a -> 'a) -> unit = ... >>> >>> i.e. the scope of the quantifier is restricted to the first argument. >>> This doesn't exist to my knowledge. Maybe it was part of some dev >>> version? >>> >>> Gerd >>> -- >>> ------------------------------------------------------------ >>> Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de >>> My OCaml site: http://www.camlcity.org >>> Contact details: http://www.camlcity.org/contact.html >>> Company homepage: http://www.gerd-stolpmann.de >>> ------------------------------------------------------------ >>> >>> >> -- > > - gregory malecha > gmalecha.github.io > --001a11492ebe448bb40532fa4be0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Right, but they can't be inferred on objects and recor= ds either, and yet they're allowed there... so what was the rationale?<= div class=3D"gmail_extra">
On Mon, May 16, 20= 16 at 2:53 PM, Gregory Malecha <gmalecha@gmail.com> wrote:<= br>

There may other reasons as= well, e.g. performance and compilability, but the main reason that I know = is that inferring these types is difficult (undecideable in general). For a= point of comparison, GHC supports types like this, but only when they are = explicitly written.


On Mon, May 16, 2016, 11:50= AM Yotam Barnoy <yotambarnoy@gmail.com> wrote:
Paging the type experts -- is there a concrete reas= on why we disallow writing this type directly?
--

- gregory malecha
=C2=A0 gmalecha.git= hub.io


--001a11492ebe448bb40532fa4be0--