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
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-03-11 (05:56)
From: David Rajchenbach-Teller <David.Teller@e...>
Subject: Re: [Caml-list] stl?

On Tue, 2009-03-10 at 23:16 -0400, Brian Hurt wrote:
> This isn't a limitation of the language, this is simply a short comming of 
> the standard libraries.

It works in Batteries, btw.

> Ord t => let foo (x: t) (y : t) = ...
> is the same as:
> module Foo(X: Ord) = struct
>  	type t = X.t;;
>  	open X;;
>  	let foo (x: t) (y: t) = ...
> end;;
> or something.  And some similar bit of syntactic sugar to make 
> instantiating a functor lower cost as well.  Obviously this idea has some 
> problems.  My point is that is that it should be possible to come up with 
> some sort of reasonable extension of the language to allow functors to be 
> more "type-class like".

How would you determine that "=>" or "foo" maps to "Foo"? IMHO, that's
the main problem with getting typeclasses in OCaml.


David Teller-Rajchenbach
 Security of Distributed Systems
   « Ce matin Un crétin A tué un chercheur. » (air connu)
   Latest News of French Research: System being liquidated. Researchers angry.