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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 3CD527F168 for ; Thu, 27 Aug 2015 15:52:44 +0200 (CEST) IronPort-PHdr: 9a23:erBihhB4SvgtXSG2+2lyUyQJP3N1i/DPJgcQr6AfoPdwSP7ypcbcNUDSrc9gkEXOFd2CrakU0KyI7+u+BSQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTskb7usMOPKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ6jiR6WagCG439Ud2wXlhtODEDh7QrmFsP6uy7+8+58wzWyPMvsTLlyVy70vIlxTxq9oycdNiUl93nXvezug69B6EaqpwZ+2JLTeIHTNP1zca7HVc8HAGBMRMJQUWpND9XvPMM0E+MdMLMA/MHGrFwUoE77XFH0CQ== Authentication-Results: mail2-smtp-roc.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 (mail2-smtp-roc.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=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.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=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.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=mail2-smtp-roc.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: A0BIAQDdFd9VnCEHlYJdhFiDI8QCOxEBAQEBAQEBARABAQEBAQgLCQkhLoIdgjAECwFFNgIFFgsCCwMCAQIBSw0GAgEBiCqjTY9jlUCBIpI6gUMFlT1wjU2EMoJ4kWyBcAELgitvgk0BAQE X-IPAS-Result: A0BIAQDdFd9VnCEHlYJdhFiDI8QCOxEBAQEBAQEBARABAQEBAQgLCQkhLoIdgjAECwFFNgIFFgsCCwMCAQIBSw0GAgEBiCqjTY9jlUCBIpI6gUMFlT1wjU2EMoJ4kWyBcAELgitvgk0BAQE X-IronPort-AV: E=Sophos;i="5.17,422,1437429600"; d="scan'208";a="175071004" Received: from mail.tu-berlin.de ([130.149.7.33]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2015 15:52:19 +0200 X-tubIT-Incoming-IP: 130.149.172.228 Received: from brego.uebb.tu-berlin.de ([130.149.172.228]) by mail.tu-berlin.de (exim-4.76/mailfrontend-8) with esmtpsa [UNKNOWN:AES128-SHA:128] for id 1ZUxbF-0007Tp-m5; Thu, 27 Aug 2015 15:52:19 +0200 To: Ocaml Mailing List From: =?UTF-8?Q?Christoph_H=c3=b6ger?= X-Enigmail-Draft-Status: N1110 Organization: =?UTF-8?Q?Technische_Universit=c3=a4t_Berlin?= Message-ID: <55DF1611.8020408@tu-berlin.de> Date: Thu, 27 Aug 2015 15:52:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: [Caml-list] Bug or useless error message Dear all, right now I am unable to produce a working example of that problem, so please bear with me. Basically, I just patched ppx_deriving_yojson to generate polymorphic functions for recursive types, i.e. type 'a foo = ... and bar = int foo [@@deriving yojson] becomes let rec foo_of_yojson : 'a. (json -> [`Ok of 'a, `Error of string]) -> json -> [`Ok of 'a, `Error of string] = ... and bar_of_yojson = ... this does, indeed, work in the test cases. If I apply this method to my (large) real world module, I get a strange error: Error: Signature mismatch: ... Values do not match: val typedef_struct_of_yojson : (Yojson.Safe.json -> [ `Error of string | `Ok of 'a ]) -> Yojson.Safe.json -> [ `Error of string | `Ok of 'a typedef_struct ] is not included in val typedef_struct_of_yojson : (Yojson.Safe.json -> [ `Error of string | `Ok of 'a ]) -> Yojson.Safe.json -> [ `Error of string | `Ok of 'a typedef_struct ] Syntactically, the types are the same, but obviously they are not equal in their internal representation. I can workaround this problem by hiding this particular function from the interface (yes, it only occurs in one function out of ~300). However, this message bugs me: Is something like this expected when using explicit generalization? 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