From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA21950; Thu, 18 Apr 2002 15:03:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA21946 for ; Thu, 18 Apr 2002 15:03:47 +0200 (MET DST) Received: from leia.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3ID3kb27321 for ; Thu, 18 Apr 2002 15:03:46 +0200 (MET DST) Received: by leia.mandrakesoft.com (Postfix, from userid 505) id 3B57D5B15; Thu, 18 Apr 2002 15:03:40 +0200 (CEST) To: Jacques Garrigue Cc: caml-list@inria.fr Subject: Re: [Caml-list] Is a Cow an Animal? References: <3CBE2CC8.1030407@ozemail.com.au> <20020418215232T.garrigue@kurims.kyoto-u.ac.jp> From: Pixel Date: 18 Apr 2002 15:03:40 +0200 In-Reply-To: <20020418215232T.garrigue@kurims.kyoto-u.ac.jp> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jacques Garrigue writes: [...] > > which type "[> `Beef | `Dead_rabbit | `Dead_human] -> bool" doesn't allow > > is_meat_ (food : [`Grass]) > > This is to avoid _too_ weak typings, which would allow for bad typos. > The more direct solution is > let is_meat_ = function > | #meat_kind -> true > | #vegetable_kind -> false ok > > all i got is > > new_human : int -> ([ `Dead_human], _[< food_kind]) animal > > Classical solution is eta-expansion > let new_human n : ([`Dead_human], [< food_kind ]) animal = > new animal `Human `Dead_human n > should work. /me is bad, i should have thought about this :-( alas, it doesn't solve the real problem, it just moves it one step later: # new_human 300;; - : ([ `Dead_human], _[< food_kind]) animal = thanks. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners