From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 6A2D27F761 for ; Tue, 1 Dec 2015 10:31:57 +0100 (CET) IronPort-PHdr: 9a23:Tlwb7Rdj7Y/nQMGKiu44cc4RlGMj4u6mDksu8pMizoh2WeGdxc68YB7h7PlgxGXEQZ/co6odzbGG7uawCCdZu8vJmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviptuDMk4R3mf1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu2pN5g/GLdRCTBuLns4/taj4RLKSA/K4noHTk0XlABJCk7L9kepcI32t37RtvB8wzWdJc3BbS47VC7qu6xrUh7zlCAfN3g592zYh9ZYkL8eqh+7ox15hYLZNtLGfMFid7/QKItJDVFKWdxcAnRM Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=christoph.hoeger@tu-berlin.de; spf=None smtp.mailfrom=christoph.hoeger@tu-berlin.de; spf=None smtp.helo=postmaster@mail.tu-berlin.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=pra; client-ip=130.149.7.33; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=mailfrom; client-ip=130.149.7.33; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.tu-berlin.de) identity=helo; client-ip=130.149.7.33; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="postmaster@mail.tu-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BRAAD2Z11WnCEHlYJehH3AK4dPOxEBAQEBAQEBARABAQEBAQgLCQkhLoItgjEECwFFNgIFFgsCCwMCAQIBSw0GAgEBiCoEm2OPcJEzgQGSRoFEBZZXllSTRTeBdgxRgV5xhXEBAQE X-IPAS-Result: A0BRAAD2Z11WnCEHlYJehH3AK4dPOxEBAQEBAQEBARABAQEBAQgLCQkhLoItgjEECwFFNgIFFgsCCwMCAQIBSw0GAgEBiCoEm2OPcJEzgQGSRoFEBZZXllSTRTeBdgxRgV5xhXEBAQE X-IronPort-AV: E=Sophos;i="5.20,368,1444687200"; d="scan'208";a="155720774" Received: from mail.tu-berlin.de ([130.149.7.33]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2015 10:31:56 +0100 X-tubIT-Incoming-IP: 91.65.128.77 Received: from ip5b41804d.dynamic.kabel-deutschland.de ([91.65.128.77] helo=[192.168.178.42]) by mail.tu-berlin.de (exim-4.76/mailfrontend-5) with esmtpsa [UNKNOWN:AES128-SHA:128] for id 1a3hHu-0007zE-9A; Tue, 01 Dec 2015 10:31:55 +0100 To: caml users From: =?UTF-8?Q?Christoph_H=c3=b6ger?= X-Enigmail-Draft-Status: N1110 Organization: =?UTF-8?Q?Technische_Universit=c3=a4t_Berlin?= Message-ID: <565D690A.7000005@tu-berlin.de> Date: Tue, 1 Dec 2015 10:31:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.12.1.92416 X-PMX-Spam: Gauge=IIIIIII, Probability=0%, Report='' Subject: [Caml-list] Constraint Inference of a poly-type variable in a class-method Dear all, As a way to work-around my latest scalability issues, I want to attach a polymorphic method to a class with this functionality: let f t = t#s val f : < s : 'a; .. > -> 'a I know I can write: object method f = f end ;; and class x = object method f : 'a 'b . ( as 'b) -> 'a = f end ;; However, the constraint might be somewhat larger, so I want it to be inferred. Is there a way to have the compiler infer a constraint on a poly-type variable? regards, Christoph -- Christoph Höger Technische Universität Berlin Fakultät IV - Elektrotechnik und Informatik Übersetzerbau und Programmiersprachen Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin Tel.: +49 (30) 314-24890 E-Mail: christoph.hoeger@tu-berlin.de