* modification to the O'CaML sets.ml
[not found] <199905141108.NAA02693@pauillac.inria.fr>
@ 1999-05-17 23:53 ` Benoit deBoursetty
0 siblings, 0 replies; only message in thread
From: Benoit deBoursetty @ 1999-05-17 23:53 UTC (permalink / raw)
To: Caml mailing list
Those who need the 1-type-variable polymorphic set data structure I've
talked of recently will find this file useful :
http://www.polytechnique.fr/eleves/1996/boursetty/polyset.ml
!! 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 set.ml
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 =
sig
val compare : 'a -> 'a -> int
end
and a functor from modules with type 'a Comparison to modules with type
(* Neither is this *)
module type 'a Set =
sig
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
.
.
.
end
That is only my personal, programmer's point of view. I don't know of the
typing problems behind it.
Benoit de Boursetty
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-05-19 17:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <199905141108.NAA02693@pauillac.inria.fr>
1999-05-17 23:53 ` modification to the O'CaML sets.ml Benoit deBoursetty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox