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.6 required=5.0 tests=MISSING_HEADERS,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 12EE5BC0B for ; Tue, 16 Jan 2007 21:49:23 +0100 (CET) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0GKnM7n020370 for ; Tue, 16 Jan 2007 21:49:22 +0100 Received: by ug-out-1314.google.com with SMTP id q2so1945604uge for ; Tue, 16 Jan 2007 12:49:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LOqU6STfrGPWEHx2kxdfPg892dNpTtuYJlfPx5QXf7qMme4H6xKKzFbCvlOdcw2PKZcyVXp2BN7bLhdOCmVxbw6Gg/g7Sy7dzfXSY3LWMhXVrm5n8i+XtbJX7Xhmm3gURoa37Uz1FpUlug+J8Z26sNCpg+BLjPeLrKmoIOIkWbk= Received: by 10.82.183.19 with SMTP id g19mr1351030buf.1168980561491; Tue, 16 Jan 2007 12:49:21 -0800 (PST) Received: by 10.82.165.20 with HTTP; Tue, 16 Jan 2007 12:49:21 -0800 (PST) Message-ID: Date: Tue, 16 Jan 2007 14:49:21 -0600 From: "Seth J. Fogarty" Subject: Re: [Caml-list] Polymorphic Variants Cc: caml-list In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-j-chkmail-Score: MSGID : 45AD3A52.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45AD3A52.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 subset:01 variants:01 beginner's:01 ocaml:01 bug:01 luther:01 thirst:98 hatred:98 polymorphic:01 polymorphic:01 beginners:01 wrote:01 caml-list:01 caml-list:01 I find them prinicipally useful in three situations: 1) When I am writing code for an easy subset of a problem, and wish to extend it later. This is the least useful case, easiest to replace. 2) When I have different overlapping kinds of data, with a common root and common parent, and functions that are only defined on certain branches of the 'type tree.' This would be the hardest to replicate. 3) When I have intermediate labelled data for gathering different subproblems together. This is the neatest use: I extend my algorithm to handle a case that might return the top two, and I just add an additional case to the destructor for `TopTwo instead of `Best or `SecondBest. On 1/16/07, Tom wrote: > I have a question... I hope it will not be dismissed right away, thou I > guess most of you will find it stupid (some might however agree with me... > hopefully). > > Cut the crap! > > So... why actually are polymorphic variants useful? Why can't they simply be > implemented as normal, concrete (or how would you call them? ...) variants? > Doesn't the use of polymorphic variants just mess up the function type? > > I'm not orthogonally against polymorphic variants, it's just that I am > looking for an alternative concept that could be used instead... Maybe > subtyped records? > > - Tom > > _______________________________________________ > 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 > > > -- Seth Fogarty sfogarty@[gmail.com|rice.edu|livejournal] Neep-neep at large AIM: Sorrath "Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred." - Martin Luther King, Jr.