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 6C28F7ED5C for ; Fri, 3 Aug 2012 06:23:37 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lambda.q.q@gmail.com) identity=pra; client-ip=209.85.212.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of lambda.q.q@gmail.com designates 209.85.212.54 as permitted sender) identity=mailfrom; client-ip=209.85.212.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vb0-f54.google.com) identity=helo; client-ip=209.85.212.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="postmaster@mail-vb0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMCAFVRG1DRVdQ2jWdsb2JhbABFuR8IIgEBAQEJCQsJEgYjgjkCLAE5Aw0FCQEGXRIBBQEWDDWHXAMMm2mCYQkDjxSFXycNiUgBBQySPwOIR4Uph1iOMD6BVIIv X-IronPort-AV: E=Sophos;i="4.77,704,1336341600"; d="scan'208";a="168956901" Received: from mail-vb0-f54.google.com ([209.85.212.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Aug 2012 06:23:36 +0200 Received: by vbmv11 with SMTP id v11so459748vbm.27 for ; Thu, 02 Aug 2012 21:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=opGc+JfzCAAm3lgznHhAu4C0cJIzvXK9tynJoMHilwI=; b=lFxI/52BcYmmVIk78GFbJCuF0LiEI8R9DXL9QCs7uZhYc0exBANrNVOwDyQSpnZw9U ThHV5wx1qAAM+Jj5aPgm6UoI/635Av7UdBksxs6KT2W99ROZjF/5i+I70hclfzhJHXlS TJ2ikWm4lDyU3UZ+UIRxfZCb6PBdEReSDylWsLV4rhSJZP15J2jvAGXYPIhBqHqrwZJy /9srjcuCjmkNGRBIiyHZyuk67y9pCjm3AdzRIXlVETeft1H8U4gGPpMU/kFOd1sAhFto 63Q7CZAAotCaB/GHsaWKvosKoCyXPBFYHjydlgM3EN2CwwPx12n/Iq3L66fYzZBdmkya eGMA== MIME-Version: 1.0 Received: by 10.52.29.176 with SMTP id l16mr221707vdh.80.1343967815638; Thu, 02 Aug 2012 21:23:35 -0700 (PDT) Sender: lambda.q.q@gmail.com Received: by 10.58.218.35 with HTTP; Thu, 2 Aug 2012 21:23:35 -0700 (PDT) Date: Fri, 3 Aug 2012 08:23:35 +0400 X-Google-Sender-Auth: oxAer8sx2TxfOahsd7Muw2eucOM Message-ID: From: Ivan To: caml-list Content-Type: multipart/alternative; boundary=20cf3078151a3d9dc604c654e43c Subject: [Caml-list] type inference with classes --20cf3078151a3d9dc604c654e43c Content-Type: text/plain; charset=ISO-8859-1 Hi! I've mentioned that in some cases ocaml can't infer type (or maybe it can, but didn't want to...) of some objects. Right to this moment, I've just do as ocaml wants - annotate a type and move forward. But now I want to make things more consciously. The reason is simple - sometimes ocaml infers types correctly and denotes a type error in my code, but I, mistakenly thinking that it can't infer type of object, loose my time in useless type annotating of different identifiers. Or vice versa, the code is correct, except for some undecidable object type, and I spend h^Wminutes in checking my code for errors. So, I'would like to know the rules of type inference failures with object types. In what cases an object type can and must be inferred, and in what it must be annotated explicitly? Can someone share this arcane knowledge or, at least, point me at some sources, explaining this issue? Thanks everybody in advance! --20cf3078151a3d9dc604c654e43c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi!

I've mentioned that in some cases ocaml can'= t infer type (or maybe it can, but didn't want to...) of some objects.<= /div>
Right to this moment, I've just do as ocaml wants - annotate = a type and move forward. But now I want to make things more=A0consciously. = The reason is simple - sometimes ocaml infers types correctly and denotes a= type error in my code, but I, mistakenly thinking that it can't infer = type of object, loose my time in useless type annotating of different ident= ifiers. Or vice versa, the code is correct, except for some undecidable obj= ect type, and I spend h^Wminutes in checking my code for errors.=A0

So, I'would like to know the rules of type inferenc= e failures with object types. In what cases an object type can and must be = inferred, and in what it must be annotated=A0explicitly?=A0

Can someone share this arcane knowledge or, at least, point me at some= sources, explaining this issue?

Thanks everybody = in advance!
--20cf3078151a3d9dc604c654e43c--