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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 0F2A47F890 for ; Mon, 24 Mar 2014 09:46:23 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=193.252.23.215; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=193.252.23.215; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@msa.smtpout.orange.fr) identity=helo; client-ip=193.252.23.215; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@msa.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkICAB/wL1PB/BfXh2dsb2JhbABZDsNtgw6BLA4BAQEKCwkHFiiCJQEBAQQnEUABEAsYCRYPCQMCAQIBRQYBDAEHAQGHec1fF456B4Q4AQOYSoZMjlNA X-IPAS-Result: AkICAB/wL1PB/BfXh2dsb2JhbABZDsNtgw6BLA4BAQEKCwkHFiiCJQEBAQQnEUABEAsYCRYPCQMCAQIBRQYBDAEHAQGHec1fF456B4Q4AQOYSoZMjlNA X-IronPort-AV: E=Sophos;i="4.97,719,1389740400"; d="scan'208";a="53827761" Received: from msa06.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.215]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Mar 2014 09:46:22 +0100 Received: from [192.168.1.133] ([92.151.100.196]) by mwinf5d34 with ME id hLmK1n00J4EEHQk03LmKm3; Mon, 24 Mar 2014 09:46:21 +0100 Message-ID: <532FF0DB.5070004@frisch.fr> Date: Mon, 24 Mar 2014 09:46:19 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Jacques Garrigue , Kiselyov Oleg CC: avatar@hot.ee, jonathan.protzenko@gmail.com, OCaml Mailing List References: <20140323044133.99286.qmail@www1.g3.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] typechecking 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