English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2003-06-06 (16:40)
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 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