Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Constructors as functions and tuples in constructors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-08 (15:57)
From: Serge <serge@s...>
Subject: [Caml-list] Constructors as functions and tuples in constructors


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 Archives:
Bug reports: FAQ:
Beginner's list: