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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 88B7DBC69 for ; Fri, 23 Nov 2007 13:33:54 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAA5XRkdA6aq9mGdsb2JhbACPNAEBAQEHBAQTGA X-IronPort-AV: E=Sophos;i="4.21,456,1188770400"; d="scan'208";a="19605706" Received: from rn-out-0910.google.com (HELO rn-out-0102.google.com) ([64.233.170.189]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Nov 2007 13:33:53 +0100 Received: by rn-out-0102.google.com with SMTP id s46so1375818rnb for ; Fri, 23 Nov 2007 04:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=vN2vgcImQ74LlQGnxm3sQvkp7LOUdjVFQ8JFBVZH/14=; b=aHC+j16v46cWTH+k4Mzflo8/TxqsMmE62YeN5fM4u5DFTcce9ue9C3gaFCgLZpqUmMqB5R0Lilzh6tEC3ST171NKdl1PdfUbOUJAfhMxi91ZzTQw7fN+SpMjxHMCBMRG7IfHa7fDryX+oC7HXdAi2WKkC8UrxYCZmM3aCUiEwwg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ug6azSlyA8LVjl1xtUomzMrZzxcPXlq+OQsIO+Pq5EJ+N5msjZfdDbDqMJOjULktOGmo+zAP6hq0yVaoRr/JhRyPbF4iMOlSgFuXXBh/8rG8niAQWeEpgWZ4NCwAe18/SMpW85wS+N14qvRWTMdJYfcHruHivFHfKqJXk/k8GpA= Received: by 10.150.135.2 with SMTP id i2mr1857514ybd.1195821232937; Fri, 23 Nov 2007 04:33:52 -0800 (PST) Received: by 10.35.89.3 with HTTP; Fri, 23 Nov 2007 04:33:52 -0800 (PST) Message-ID: Date: Fri, 23 Nov 2007 06:33:52 -0600 From: "Angela Zhu" To: "Jonathan T Bryant" Subject: Re: [Caml-list] Type issue Cc: caml-list@yquem.inria.fr In-Reply-To: <2921298.1195790493072.JavaMail.jtbryant@valdosta.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2921298.1195790493072.JavaMail.jtbryant@valdosta.edu> X-Spam: no; 0.00; bool:01 bool:01 val:01 beginner's:01 ocaml:01 bug:01 angela:98 angela:98 22.:98 hen:98 beginners:01 wrote:01 rec:01 typing:01 caml-list:01 I think it is because you have "if f c then ... else ..." --- this restrict "f c" must be bool, thus 'a is bool. On Nov 22, 2007 10:01 PM, Jonathan T Bryant wrote: > List, > > I don't understand the following typing: > > # 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 = > > I don't understand why f isn't of type 'a t -> 'a. I understand that f > is applied to a bool t, but I would think that that would just be a > particular instantiation of 'a, not enough to fully determine its type. > > --Jonathan Bryant > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Regards, Angela Zhu ------------------------------------------ Dept. of CS, Rice University http://www.cs.rice.edu/~yz2/ ------------------------------------------