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
[Caml-list] Why must types be always defined at the top level?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-25 (10:20)
From: skaller <skaller@u...>
Subject: RE: [Caml-list] Why must types be always defined at the top level?
On Fri, 2004-06-25 at 05:46, John Hughes wrote:
> Thanks for the answers.  
> > > 1. Why no eqtypes? 
> > 
> > Eqtypes have been hotly debated even among the SML designers. 

Hmm .. but interesting Ocaml has a slot to marshal
abstract types .. and to finalise them .. but not
to compare them. Bignums in particular don't work
with polymorphic compare or hash, which means you can't
for example use them as keys to a hashtable .. as I just
discovered again :(

Any thoughts on a way to fix that?

My hashtable keys are terms which might contain
integers which happen to be represented by big ints,
so just using a custom hashtable won't work.

In this case, I'd be more than happy to just
hash the term's address (this would be heaps
faster than the recursive polymorphic comparison)

Is there a way to use an address as a comparable
but otherwise opaque value?

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: