From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A4F22BC69 for ; Fri, 23 Nov 2007 09:30:54 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAM4eRkfUCb2nh2dsb2JhbACPNwEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.21,455,1188770400"; d="scan'208";a="4815539" Received: from mail.enyo.de ([212.9.189.167]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Nov 2007 09:30:51 +0100 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1IvTw4-0004xj-Cz; Fri, 23 Nov 2007 09:30:52 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.68) (envelope-from ) id 1IvTw2-0002IN-DR; Fri, 23 Nov 2007 09:30:50 +0100 From: Florian Weimer To: Jonathan T Bryant Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Type issue References: <2921298.1195790493072.JavaMail.jtbryant@valdosta.edu> Date: Fri, 23 Nov 2007 09:30:50 +0100 In-Reply-To: <2921298.1195790493072.JavaMail.jtbryant@valdosta.edu> (Jonathan T. Bryant's message of "Thu, 22 Nov 2007 23:01:33 -0500 (EST)") Message-ID: <87oddlweh1.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; bool:01 bool:01 val:01 val:01 hen:98 hen:98 rec:01 rec:01 caml-list:01 cond:02 cond:02 expression:02 match:02 match:02 florian:03 * Jonathan T. Bryant: > # type 'a t = Cond of bool t * 'a t * 'a t | Value of 'a;; > type 'a t = Cond of bool t * 'a t * 'a t | Value of 'a > > # let rec f t = match t with > Cond (c,t,e) -> if f c then f t else f e > | Value x -> x > ;; > val f : bool t -> bool = # let rec g t = match t with Cond (c,t,e) -> if f c then g t else g e | Value x -> x ;; val g : 'a t -> 'a = The return value of f can't be generalized 'a because it's constrained to bool in the if expression. This problem does not arise for g.