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
modification to the O'CaML
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-05-19 (17:45)
From: Benoit deBoursetty <b-db@g...>
Subject: modification to the O'CaML
Those who need the 1-type-variable polymorphic set data structure I've 
talked of recently will find this file useful :

!! Warning !! The URL will stop being effective at the beginning of July.
Would anyone download this very small file to a more persistent website ?

It is a small modification to the original

In fact, only type declarations are modified, the code is just the same. 
Doesn't this mean that the compiler polymorphism handling could be
enhanced ? 

In the case of sets I feel like declaring something like

(* This is not valid o'caml *)
module type 'a Comparison =
    val compare : 'a -> 'a -> int

and a functor from modules with type 'a Comparison to modules with type

(* Neither is this *)
module type 'a Set =
    type 'a t
    val empty: 'a t
    val is_empty: 'a t
    val mem: 'a -> 'a t -> bool
    val add: 'a -> 'a t -> 'a t

That is only my personal, programmer's point of view. I don't know of the
typing problems behind it.

Benoit de Boursetty