Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Dan Grossman <djg@cs.washington.edu>
To: caml-list@yquem.inria.fr
Cc: Ben Lerner <blerner@cs.washington.edu>
Subject: Re: Teaching bottomline, part 3: what should improve.
Date: Tue, 22 May 2007 22:21:32 -0700	[thread overview]
Message-ID: <4653CF5C.4040305@cs.washington.edu> (raw)
In-Reply-To: <20070522234715.0BCB2BC74@yquem.inria.fr>


 >>  * Error messages of the type system are somewhat obscure. The reflex
 >> of many students is "OCaml wants it to be of type XXX", rather than 
 >> "there is a contradiction in what I wrote". It would be nice if 
there >> was a way to ask OCaml to display additional information on type
 >> errors.

 > This is a long standing peeve of mine. Lets face it: Ocaml just lies.
 > If it has inferred a type, then finds a contradiction, it should
 > report both the location of the contradication AND all of the source
 > lines that contributed to the inference.

Reporting all of the source lines has been investigated; see

C. Haack and J. B. Wells. Type error slicing in implicitly typed
higher-order languages. Science of Computer Programming, 50(1-
3):189–224, 2004.

My intuition is there are many situations where this gives you too much 
information just as one location gives you too little.

Switching to personal horn-tooting mode, you may be interested in a 
paper we have in PLDI next month where we take a completely different 
approach to presenting Caml type-errors -- we don't report any types at 
all, but rather we report a similar program that does type-check.

See http://www.cs.washington.edu/homes/blerner/seminal.html.  The PLDI 
paper is the place to start.  The prototype implementation may prove 
useful to the very brave of heart, but it's really designed to 
demonstrate the idea.

--Dan


       reply	other threads:[~2007-05-23  5:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070522234715.0BCB2BC74@yquem.inria.fr>
2007-05-23  5:21 ` Dan Grossman [this message]
2007-05-23  8:03   ` [Caml-list] " Loup Vaillant
2007-05-23 12:51     ` David Teller
2007-05-24 16:30       ` Loup Vaillant
2007-05-24 18:08         ` Jon Harrop
2007-05-24 21:29         ` David Teller
2007-05-25  7:58           ` Loup Vaillant
2007-05-25  9:57           ` Markus E.L.
2007-05-22 22:10 David Teller

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=4653CF5C.4040305@cs.washington.edu \
    --to=djg@cs.washington.edu \
    --cc=blerner@cs.washington.edu \
    --cc=caml-list@yquem.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