caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Constructors as functions and tuples in constructors
@ 2003-10-08 15:57 Serge
  2003-10-08 16:07 ` Dan Grossman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Serge @ 2003-10-08 15:57 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-10-09 12:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-08 15:57 [Caml-list] Constructors as functions and tuples in constructors Serge
2003-10-08 16:07 ` Dan Grossman
2003-10-08 16:33   ` Andreas Rossberg
2003-10-08 17:05     ` Dan Grossman
2003-10-09 12:40       ` Andreas Rossberg
2003-10-08 18:28     ` Alain.Frisch
2003-10-08 18:44       ` Marcin 'Qrczak' Kowalczyk
2003-10-08 16:13 ` Michal Moskal
2003-10-08 16:25 ` Nicolas Cannasse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).