Version française
Home     About     Download     Resources     Contact us    
Browse thread
Announce: xsetxmap, unfunctorized, Sexp-lib aware versions of Set and Map
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Hurt <bhurt@j...>
Subject: Re: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions of Set and Map
Jon Harrop wrote:

>Actually I would say that your style is more useful than the built-in Set and 
>Map modules because you don't have to jump through hoops defining your 
>own "Int" module with its own "int" type and its own comparison function over 
>ints every time you want a set of integers. I would put the comparison 
>function in the set itself though.
>
>  
>
IMHO, the Int module should be in the standard library, and the Set and 
Map modules should have already instantiated sets and maps for the 
standard base types (int, float, string, char).

Also, I'm not as down on functors as a lot of programmers seem to be.  
While not perfect, they solve a number of problems very well.  For 
example, there are a number of operations on sets and maps which are 
O(N) if and only if you know the two trees are in the same order, but 
O(N log N) if you don't know they're in the same order.  Functors lift 
this check into the type system.

Brian