Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>,
	 Kiselyov Oleg <oleg@okmij.org>
Cc: avatar@hot.ee, jonathan.protzenko@gmail.com,
	 OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] typechecking
Date: Mon, 24 Mar 2014 09:46:19 +0100	[thread overview]
Message-ID: <532FF0DB.5070004@frisch.fr> (raw)
In-Reply-To: <CE9F7F44-8DFE-411F-97C1-9FC0727259BB@math.nagoya-u.ac.jp>

On 03/23/2014 01:59 PM, Jacques Garrigue wrote:
> So well, unsound functions are unsound, and you have to live with that.
> In particular _always_ annotate with ground types.

It might be useful to check that the user provides an explicit type for 
the result of input_value and similar functions.  This could be 
implemented in the same way as the new warning on deprecated 
declarations, i.e. with a compiler-recognized attribute on those special 
functions:


  val input_value: in_channel -> 'a
     [@@requires_explicit_type]


The compiler would raise a warning if the call site does not provide 
explicit type information such as:

    let x : ... = input_value ic in ...

or:

   let x = (input_value ic : x) in ...


The notion of "explicit type information" could probably be the same as 
the one used for type propagation, or even a more syntactic criterion.


-- Alain

      reply	other threads:[~2014-03-24  8:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-22 20:02 Misha Aizatulin
2014-03-22 20:40 ` Daniel Bünzli
2014-03-22 22:12   ` Yaron Minsky
2014-03-22 22:24     ` Jonathan Protzenko
2014-03-23  4:41 ` oleg
2014-03-23 12:59   ` Jacques Garrigue
2014-03-24  8:46     ` Alain Frisch [this message]

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=532FF0DB.5070004@frisch.fr \
    --to=alain@frisch.fr \
    --cc=avatar@hot.ee \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=jonathan.protzenko@gmail.com \
    --cc=oleg@okmij.org \
    /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