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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
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.