From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 392A9BC84 for ; Thu, 31 Mar 2005 00:31:05 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2UMV4Er018385 for ; Thu, 31 Mar 2005 00:31:04 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA15631 for ; Thu, 31 Mar 2005 00:31:04 +0200 (MET DST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.192]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2UMV3Sw024651 for ; Thu, 31 Mar 2005 00:31:03 +0200 Received: by wproxy.gmail.com with SMTP id 69so325572wri for ; Wed, 30 Mar 2005 14:31:03 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=Eh03/++65A7hsfKFOnEDcQcgTlY3JnNAJn34xuKD68WeBHlPdx/cQBQUogoLiJfLmA5ZwbvRmFDXCrJ00ukSxhSWPmFnzq+ZxRuEQON51PNwhIRUUYRLyDD6Sn3mZ9/FY2wRzWei5tOK/kB51r+tJvpcwh8xTV7mrmu7a2P6eK0= Received: by 10.54.57.31 with SMTP id f31mr369685wra; Wed, 30 Mar 2005 14:31:02 -0800 (PST) Received: by 10.54.2.79 with HTTP; Wed, 30 Mar 2005 14:31:02 -0800 (PST) Message-ID: <891bd33905033014311636570a@mail.gmail.com> Date: Wed, 30 Mar 2005 17:31:02 -0500 From: Yaron Minsky Reply-To: yminsky@cs.cornell.edu To: Caml Mailing List Subject: When is a function polymorphic? Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 424B28A8.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 424B28A7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 yaron:01 polymorphic:01 idiom:01 unit:02 unit:02 seems:03 quite:06 examples:07 fun:08 fun:08 cases:08 cases:08 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: I don't understand the following results. It seems like these two examples should have the same type. In this example, there isn't much of a difference between the two cases, but there are cases where this idiom is quite convenient. Any idea how to salvage it? # function Some x -> Some () | None as x -> x;; - : 'a option -> unit option = # function Some x -> Some () | x -> x;; - : unit option -> unit option = Yaron