Browse thread
[Caml-list] Constructors as functions and tuples in constructors
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Serge <serge@s...> |
| Subject: | [Caml-list] Constructors as functions and tuples in constructors |
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