Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] subtyping, polymorphism, higher order types.....
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Vasile Rotaru <vrotaru@s...>
Subject: Re: [Caml-list] subtyping, polymorphism, higher order types.....
On Thu, 03 Jul 2003 10:33:15 -0400
Shaddin Doghmi <shaddin@mitre.org> wrote:

> In my experiences with ocaml, one of the major frustrations i
> constantly run into is the lack of subtyping. [..]

  The Shaddin message (and other influences -- the most notable being
the Oberon language) had induced me to an idea which I offer here for
discussion. Open (or extensible) product types. Something like this

    type point = int * int * _ ;;

where the underscore stands for any sequences of types. Colour, taste,
strangeness, etc.

  Now a function designed to work with with "point" will work with any
type which is a "point" extension. Just now I cannot think of a good
"ocamlish" syntax for extending types. Maybe?

    type color_point = <point> * int * _

  The big question is what this will do with the type system of Ocaml
and whether it worth the pain..

> just a few thoughts.....
> 

just a few thoughts

Vasile Rotaru

-- 
They spell it "da Vinci" and pronounce it "da Vinchy".  Foreigners
always spell better than they pronounce.
		-- Mark Twain

-------------------
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