Version française
Home     About     Download     Resources     Contact us    
Browse thread
Defining type that requires hashtables with recursive definition
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hugo Ferreira <hmf@i...>
Subject: Re: [Caml-list] Defining type that requires hashtables with recursive definition
Jacques Carette wrote:
> Hugo Ferreira wrote:
>> I am attempting to define a type so:
>>
>> type node =
>>   | Node of links
>>   | Leaf of int
>>
>> And I want to implement links as a
>> hashtable whose keys and values are
>> also of type node.
> 
> type node =
>  | Node of links
>  | Leaf of int
> and links = (node, node) Hashtbl.t
> 
> should do it.
> 

I already had considered this but I assume that
the hash-table equality is a structural comparison
and not the (==) that I need.

Thanks for the suggestion.

R.
Hugo F.

> Jacques
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>