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 RAA17357; Wed, 8 Oct 2003 17:57:09 +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 RAA15215 for ; Wed, 8 Oct 2003 17:57:07 +0200 (MET DST) Received: from shade.msu.ru (shade.msu.ru [193.232.127.27]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h98Fv6128677 for ; Wed, 8 Oct 2003 17:57:06 +0200 (MET DST) Received: from localhost (serge@localhost) by shade.msu.ru (8.11.6/8.9.3) with ESMTP id h98Fv3Q23021 for ; Wed, 8 Oct 2003 19:57:03 +0400 Date: Wed, 8 Oct 2003 19:57:03 +0400 (MSD) From: Serge To: caml-list@inria.fr Subject: [Caml-list] Constructors as functions and tuples in constructors Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; generality:01 int:01 int:01 constructors:01 constructors:01 match:02 match:02 arity:03 constructor:03 anybody:03 moscow:03 let:04 functions:05 functions:05 prohibiting:93 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Gentlemen! There are two features, which might it be useful to support in the language w/out modifying it much. And they both are about greater generality of the language. First, it would be nice to have constructors as functions like below: List. map Some [17] Second, it would also be nice not to have "the concept of constructor arity", and treat the code below as correct: type t = A of int * int let _ = match A (17, 0) with A z -> match z with (x, y) -> () Does anybody know, whether this is possible? Or, if not, what are the prohibiting reasons? ------------------------------------------------------------------------------- Serge S. Bityukov, Moscow State University, Dept of Mechanics and Mathematics ------------------- 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