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] Why are arithmetic functions not polymorph?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff@s...
Subject: Re: easy print and read (was: [Caml-list] Why are arithmetic functions not polymorph?)
On Fri, 6 Jun 2003, Pierre Weis wrote:
[... snipped lots of good stuff I enthusiastically agree with ...]
> Bibliography and further readings:
> ==================================

Let me add that if you don't want to read lots of type theory papers even if 
it's good for you, that the GCaml implementation README at

takes you on a quick walk through what you can do, and it's pretty cool. 

I'm really looking forward to the next version, which will hopefully include 
modules. I also wonder about how the object system will fit in with all of 
this. The interaction of generics with all of this "non-core" ML is still 
a mystery to us anxious users :-)

BTW, someone (Brian Hurt?) brought up a nice simple example of where the 
current generic polymorphism seems a bit weak

generic one = | int => 1 | float => 1.0 ;;
generic two = | int => 2 | float => 2.0 ;;
generic plus = | float -> float -> float => (+.) | int -> int -> int => (+);;

plus one two;; (* Can't determine plus without at least one type annotation *)

and it would be nice if in such situations the correct plus could be inferred. 

This is very exciting stuff! Beyond overloading, this system provides a type 
safe value IO and dynamic typing capabilities. 

-- Brian

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: