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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id EF6CD7ED26 for ; Thu, 24 May 2012 19:55:51 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAKZ1vk/RVda2kGdsb2JhbABDom6RbwgiAQEBAQkJDQcUBCOCDAoBAQQSAiwBGx4DDAYIAQIFOwIgAREBBQEcBjWHXAEDC50MCQOMIoJwhQwKGScNV4hxAQUMkBMDjjWBHYVGjhU9hCQ X-IronPort-AV: E=Sophos;i="4.75,652,1330902000"; d="ml'?scan'208";a="145120332" Received: from mail-ob0-f182.google.com ([209.85.214.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 24 May 2012 19:55:51 +0200 Received: by obcni5 with SMTP id ni5so83444obc.27 for ; Thu, 24 May 2012 10:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jWJaBuxeUyONi6dnYprV7krr5wQ7+sDedMrgHyl2D30=; b=Zw23FkDilyIx2hz89owJMDTRoTNLFyhbFjzJPC1BGFj66yL+DT9F40CoE07ucK1gQB 8yJ1TIK56jvqeBIFoI3Qcaarmfjaki471SvE9NFZxzbnHYgheWIaljve4TfEvbfITQaJ 5x6+7GsYpbi5NsAPZPMUvd0M1eqvddlNuAVoBny51oV7l5MpfoSSauDE+k07QG0vJdaZ n1R7CuzVV1vs/7gXQqaYYBK2nObma7VhoV8DaRiE3H0F81JT+wjygzpchH8IKElzqH19 a0RUwCxz4Q9RMYKcecxHynsmcO/wUczQCzRLzgs60ay+WxqGjoAjwOA9yZHHGdHqk3MD pgIg== MIME-Version: 1.0 Received: by 10.182.207.41 with SMTP id lt9mr355440obc.41.1337882150018; Thu, 24 May 2012 10:55:50 -0700 (PDT) Received: by 10.182.182.97 with HTTP; Thu, 24 May 2012 10:55:49 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 May 2012 13:55:49 -0400 Message-ID: From: bob zhang To: Caml List Content-Type: multipart/mixed; boundary=e89a8f6435884d9de604c0cbf688 Subject: [Caml-list] A weird typing error --e89a8f6435884d9de604c0cbf688 Content-Type: multipart/alternative; boundary=e89a8f6435884d9de104c0cbf686 --e89a8f6435884d9de104c0cbf686 Content-Type: text/plain; charset=ISO-8859-1 Hi, list I came across a weird type error. The error message is "Error: The implementation type_error_ppo.ml does not match the interface (inferred signature):" I attached the file Many thanks -- -- Bob --e89a8f6435884d9de104c0cbf686 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, list
=A0 =A0 I came across a weird t= ype error.
=A0 =A0 The error message is =A0"Error: The imple= mentation type_error= _ppo.ml
=A0 =A0 =A0 =A0does not match the interface (inferred signature):"= ;
=A0 =A0 I attached the file=A0
=A0 =A0Many thanks

--
-- Bob
--e89a8f6435884d9de104c0cbf686-- --e89a8f6435884d9de604c0cbf688 Content-Type: application/octet-stream; name="type_error_ppo.ml" Content-Disposition: attachment; filename="type_error_ppo.ml" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h2m45c8m0 dHlwZSAnYSBtX2xpc3QgPSB8IE1fbmlsIHwgTV9jb25zIG9mICdhICogJ2Eg bV9saXN0Cgp0eXBlICdhIHR3aWNlID0gJ2EKCnR5cGUgJ2EgdHJlZSA9CiAg fCBMZWFmIHwgTm9kZSBvZiAoJ2EgdHJlZSkgbV9saXN0ICogKCgnYSB0cmVl KSBtX2xpc3QpIHR3aWNlICogJ2EKCmNsYXNzIGJhc2UgPQogIG9iamVjdCBt ZXRob2QgaW50IDogaW50IC0+IGludCA9IGZ1biB4IC0+IHgKICAgIG1ldGhv ZCBmbG9hdCA6IGZsb2F0IC0+IGZsb2F0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90 eXBlIC0+ICdhMCAtPiAnYjApIC0+ICdhMCBtX2xpc3QgLT4gJ2IwIG1fbGlz dCA9CiAgICAgICAgICBmdW4gbWZfYSAtPgogICAgICAgICAgICBmdW5jdGlv bgogICAgICAgICAgICB8IE1fbmlsIC0+IE1fbmlsCiAgICAgICAgICAgIHwg TV9jb25zIChhMCwgYTEpIC0+CiAgICAgICAgICAgICAgICBNX2NvbnMgKCht Zl9hIHNlbGYgYTApLCAoc2VsZiNtX2xpc3QgbWZfYSBhMSkpCiAgICAgIGVu ZAogICAgICAKICBlbmQKICAKCg== --e89a8f6435884d9de604c0cbf688-- 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id AFCEF7ED26 for ; Fri, 25 May 2012 00:17:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhoPAEeyvk/RVda2kGdsb2JhbABEpWuOcwgiAQEBAQkJDQcUBCOCFQEBAQQSAhMZATgBAwwBBQULDS4hARIBBQEcBhMbB4ddAwudFAkDjxKFHycNiUgBBQyKEmGFIAONEogGineDHj2BU4I3 X-IronPort-AV: E=Sophos;i="4.75,653,1330902000"; d="scan'208";a="159885637" Received: from mail-ob0-f182.google.com ([209.85.214.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 25 May 2012 00:17:35 +0200 Received: by obcni5 with SMTP id ni5so522992obc.27 for ; Thu, 24 May 2012 15:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FppgwXCAP4jV8/0AdFFKzqp6J16aC2igEQWWsjSLYlM=; b=yK0L5DtLrdnvlu0E5uuwKFFS+NI0fJ0e/FDUXXmjDE9JPHbl0ivuwMkxZvZBFN1oFM Y/S51VhiTTKKKzzY1MFT2zcPGYTKixdOc6COaNG8caxJvQWICgIHlAmAznudnKO4mzHM dX3dnF7WmILfq4SFO1h/8K3lMLjmDSmV2pvKpmrjO8UWxNRj9nvI+scN+Jw8I9f2jdsk ssltClwRRoi0fQlq63z64vchWMfomejCAJgs3u1gp5GQW9+28PUirnoWYIYGayASnDvF Uu85i4d1TUQk6+/hHgQurB1FgkHWF/yG67mj2ghd16fELU+6dkibC951F1j9t878WZvH jHqw== MIME-Version: 1.0 Received: by 10.182.167.39 with SMTP id zl7mr1152441obb.10.1337897853943; Thu, 24 May 2012 15:17:33 -0700 (PDT) Sender: philippe.wang.lists@gmail.com Received: by 10.182.60.193 with HTTP; Thu, 24 May 2012 15:17:33 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 May 2012 00:17:33 +0200 X-Google-Sender-Auth: LE363F5yW7Ngbm2qphsRaVxaI7A Message-ID: From: Philippe Wang To: bob zhang Cc: Caml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] A weird typing error Hi, I re-wrote your program, twice. First time: The actual problem was submerged... so I removed the irrelevant code. It became: type 'a twice =3D 'a class map =3D object ((self : 'self_type)) method twice : 'a0 'b0. ('self_type -> 'a0 -> 'b0) -> 'a0 twice -> 'b0 tw= ice =3D fun mf_a -> mf_a self end =3D> ocamlc points a surprising error at line 1. I don't quite understand... Second time: well, line 1 seems fine to me. I added some missing parameters. It became: type 'a twice =3D 'a class map =3D object ((self : 's)) method twice : 'a0 'b0. ('s -> 'a0 -> 'b0) -> 'a0 twice -> 'b0 twice =3D fun mf_a x -> mf_a (self : 's) (x: 'a0 twice) end =3D> ocamlc points the same error, but at line 5, which is a lot better, much less weird... Well, kind of same error: the weird (buggy) part of the message is removed, the important part is kept. And now... I just don't know why it doesn't type-check. All I have left to say is that I hate encoding data into type names. It's fun when it works. It's hell otherwise. I'm curious to understand the solution of this weird problem, if someone unravels it. Cheers. Philippe Wang On Thu, May 24, 2012 at 7:55 PM, bob zhang wrote: > > Hi, list > =A0 =A0 I came across a weird type error. > =A0 =A0 The error message is =A0"Error: The implementation type_error_ppo= .ml > =A0 =A0 =A0 =A0does not match the interface (inferred signature):" > =A0 =A0 I attached the file > =A0 =A0Many thanks > > -- > -- Bob 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 465CE7ED26 for ; Fri, 25 May 2012 07:47:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuABAJMcv0/RVde2kGdsb2JhbABEhTSvRggiAQEBAQkJDQcUBCOCFQEBAQQSAg8EEQgBGxwBAQMMBgULAwoCAgUWCwICCQMCAQIBDwIRAQUBHAYNAQUCAQEXB4dcAQMLAZ0PCQOLUlCCcIRuChknDVeIcQEFDIEYiHphhDSBEgOVGIp3gx49hAA X-IronPort-AV: E=Sophos;i="4.75,655,1330902000"; d="scan'208";a="145158194" Received: from mail-ey0-f182.google.com ([209.85.215.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 25 May 2012 07:47:38 +0200 Received: by eabm6 with SMTP id m6so157788eab.27 for ; Thu, 24 May 2012 22:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=EUm9HbxofImoLUDsb9u4QORd5K9sfPhcPWRq2IuSA6A=; b=PjX24CIdTFcqAbATdJi08UbwTSpRU3AYh+eBiX5t343AadQFoLY+3JZkCK6wadhwNe fTqNKy+HBYlmGWLjZTIjIqHOnRpP2YDFopBH/sZm+0cBuO3wXFBK5zvHiREWQGKRoVqt AigHK/VlpBla67RaIdmMjA4xlIzxeLZ2g0RErGkqxDj6mMOKNpvz9nPR/f5bhDiSZViK aOUkRL3mnvh5kGCuqja8K1gXk/yiLKdIszsyRKuL6YvTV4WUBQHaMuvw1bYfbgah/yRI RJjWarzkH+Q9e4mLNxUN83L+3RMRaxMcVBw4qQQDSf6N9XkaIVjvtUHNR+pWbpH3ERoH kZSg== Received: by 10.14.127.201 with SMTP id d49mr394235eei.52.1337924857873; Thu, 24 May 2012 22:47:37 -0700 (PDT) Received: from ?IPv6:2a01:e35:2f37:f210:5e26:aff:fe0c:c1d8? ([2a01:e35:2f37:f210:5e26:aff:fe0c:c1d8]) by mx.google.com with ESMTPS id z5sm3241450eem.3.2012.05.24.22.47.34 (version=SSLv3 cipher=OTHER); Thu, 24 May 2012 22:47:36 -0700 (PDT) Message-ID: <4FBF1CF4.8030003@gmail.com> Date: Fri, 25 May 2012 07:47:32 +0200 From: Jonathan Protzenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/15.0 Thunderbird/15.0a1 MIME-Version: 1.0 To: Philippe Wang CC: Caml List , bob zhang References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] A weird typing error FWIW it type-checks on a recent trunk build. jonathan On Fri 25 May 2012 12:17:33 AM CEST, Philippe Wang wrote: > Hi, > > I re-wrote your program, twice. > > First time: The actual problem was submerged... so I removed the > irrelevant code. > It became: > > type 'a twice = 'a > class map = object ((self : 'self_type)) > method twice : 'a0 'b0. ('self_type -> 'a0 -> 'b0) -> 'a0 twice -> 'b0 twice = > fun mf_a -> mf_a self > end > > => ocamlc points a surprising error at line 1. I don't quite understand... > > Second time: well, line 1 seems fine to me. I added some missing parameters. > It became: > > type 'a twice = 'a > class map = > object ((self : 's)) > method twice : 'a0 'b0. ('s -> 'a0 -> 'b0) -> 'a0 twice -> 'b0 twice = > fun mf_a x -> mf_a (self : 's) (x: 'a0 twice) > end > > => ocamlc points the same error, but at line 5, which is a lot better, > much less weird... > Well, kind of same error: the weird (buggy) part of the message is > removed, the important part is kept. > > > And now... I just don't know why it doesn't type-check. All I have > left to say is that I hate encoding data into type names. It's fun > when it works. It's hell otherwise. > > I'm curious to understand the solution of this weird problem, if > someone unravels it. > > Cheers. > Philippe Wang > > > > On Thu, May 24, 2012 at 7:55 PM, bob zhang wrote: >> >> Hi, list >> I came across a weird type error. >> The error message is "Error: The implementation type_error_ppo.ml >> does not match the interface (inferred signature):" >> I attached the file >> Many thanks >> >> -- >> -- Bob >