caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ivan <ivg@ieee.org>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] type inference with classes
Date: Fri, 3 Aug 2012 08:23:35 +0400	[thread overview]
Message-ID: <CAL9dnAFiQGxnUmyWsbeTvHz2rmUV9HUOwJmpHa3imrZK0Eri=A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

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!

[-- Attachment #2: Type: text/html, Size: 1072 bytes --]

             reply	other threads:[~2012-08-03  4:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  4:23 Ivan [this message]
2012-08-03  4:50 ` Alain Frisch
2012-08-03  5:15   ` Ivan
2012-08-03  5:32     ` Jacques Garrigue
2012-08-03  6:09       ` Ivan
2012-08-03 23:14 Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL9dnAFiQGxnUmyWsbeTvHz2rmUV9HUOwJmpHa3imrZK0Eri=A@mail.gmail.com' \
    --to=ivg@ieee.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).