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 8CBB97F168 for ; Thu, 27 Aug 2015 16:10:43 +0200 (CEST) IronPort-PHdr: 9a23:FAGGaRWN/egcVK0By9ymtNNv2g7V8LGtZVwlr6E/grcLSJyIuqrYZxSHt8tkgFKBZ4jH8fUM07OQ6PC7HzJcqsnZ+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8aVPVkD22L1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S43Un8XiQZPGwjyzI/1U4255iD6rOtmxC6CPYv2Sr07VC6K87ouQhLyjCYBcTI0pjL5kMt12YBSqwu8qgc37IfOeoCaKfc2KqzUZ8kbSndMdsNYSywHBIqzaJoGSvdHNO0erZGr9AhGlge3GQT5XLCn8TRPnHKjmPRii+k= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jacques.garrigue@gmail.com; spf=Pass smtp.mailfrom=jacques.garrigue@gmail.com; spf=None smtp.helo=postmaster@mail-pa0-f43.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jacques.garrigue@gmail.com) identity=pra; client-ip=209.85.220.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jacques.garrigue@gmail.com designates 209.85.220.43 as permitted sender) identity=mailfrom; client-ip=209.85.220.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pa0-f43.google.com) identity=helo; client-ip=209.85.220.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="postmaster@mail-pa0-f43.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AoAwBSGd9VlCvcVdFdhFiDI6oRkE2Hc4ExOhIBAQEBAQEBARABAQEBBwsLCR8wgh2CBwEBBBIRBBkBOAEDDAEFBRgCAhgOAgI0AQUBHAY1h3cDEQEFpUmBLz4xi0CEZYpMJw1HhGgBAQEBBgEBAQEBAQEVAQUOgRSHVoJphFiDIy+BFAWNYIddjHOBSoQygmyQLDWBFxdJg1Rigk0BAQE X-IPAS-Result: A0AoAwBSGd9VlCvcVdFdhFiDI6oRkE2Hc4ExOhIBAQEBAQEBARABAQEBBwsLCR8wgh2CBwEBBBIRBBkBOAEDDAEFBRgCAhgOAgI0AQUBHAY1h3cDEQEFpUmBLz4xi0CEZYpMJw1HhGgBAQEBBgEBAQEBAQEVAQUOgRSHVoJphFiDIy+BFAWNYIddjHOBSoQygmyQLDWBFxdJg1Rigk0BAQE X-IronPort-AV: E=Sophos;i="5.17,422,1437429600"; d="scan'208";a="175074318" Received: from mail-pa0-f43.google.com ([209.85.220.43]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 27 Aug 2015 16:10:42 +0200 Received: by pacdd16 with SMTP id dd16so27000630pac.2 for ; Thu, 27 Aug 2015 07:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Ms/dmbA0lBEgayEurOOZlX1fKvYjO0AbCRDgP2j0Yj4=; b=kcuK5qFPqyjw/y8dQZWlthj2KQG6xrGywagZDvWSQH4RktzltqV8WBAciB5N4RSwqf DDgZ5fX/b71JifORQC3MWK6lNkhKdQeKGWQtvRfAMwAG81Zn6lFn2OAeWXKdjYhCC7kD QwJ0Qj8TxpitCdlkoxx91c3/kiuHsFGIXrt0adhJ5fq6Yp3EGzUYPHjrZQHNe9RLtHUP o6huVkpqxaZbGGKTjQDJcplz1UhkxvKffgCRM4mH1V7scey/N6/3fU7JEXwyYfXgPv6F aP9kpvPisvFEtXdJSKNKF29nrFZ+ZCPZnon5eKZ8c0RnEkio7HDQboIMvqwZ0pNN3sbb sm7A== X-Received: by 10.68.65.16 with SMTP id t16mr6983005pbs.48.1440684640979; Thu, 27 Aug 2015 07:10:40 -0700 (PDT) Received: from tanpopo.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp. [58.158.128.157]) by smtp.gmail.com with ESMTPSA id ov5sm2106349pdb.58.2015.08.27.07.10.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Aug 2015 07:10:40 -0700 (PDT) Sender: Jacques Garrigue Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 From: Jacques Garrigue In-Reply-To: <55DF1611.8020408@tu-berlin.de> Date: Thu, 27 Aug 2015 23:10:38 +0900 Cc: OCaml Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <0F5E857D-B7D0-4A2A-B1EA-DAA2E6596580@math.nagoya-u.ac.jp> References: <55DF1611.8020408@tu-berlin.de> To: =?utf-8?Q?Christoph_H=C3=B6ger?= X-Mailer: Apple Mail (2.2104) Subject: Re: [Caml-list] Bug or useless error message You should submit a bug report, with all the source files required. Impossible to tell you anything without more information. Jacques Garrigue On 2015/08/27 22:52, Christoph H=C3=B6ger wrote: >=20 > Dear all, >=20 > right now I am unable to produce a working example of that problem, so > please bear with me. >=20 > Basically, I just patched ppx_deriving_yojson to generate polymorphic > functions for recursive types, i.e. >=20 > type 'a foo =3D ... > and bar =3D int foo [@@deriving yojson] >=20 > becomes >=20 > let rec foo_of_yojson : 'a. (json -> [`Ok of 'a, `Error of string]) -> > json -> [`Ok of 'a, `Error of string] =3D ... > and bar_of_yojson =3D ... >=20 > this does, indeed, work in the test cases. >=20 > If I apply this method to my (large) real world module, I get a strange > error: >=20 > 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 ] >=20 > Syntactically, the types are the same, but obviously they are not equal > in their internal representation. >=20 > 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? >=20 > regards, >=20 > Christoph