Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] possible to define a type where = is forbidden ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Thomas Fischbacher <Thomas.Fischbacher@P...>
Subject: Re: [Caml-list] EQ hash tables?

On Wed, 12 Oct 2005, Xavier Leroy wrote:

> Alternatively, you can always put
> unique integers in the data type used as key.

Suppose I define:

type network = Links of network array

and now, I set out to construct a wildly linked such network, which may 
indeed have the property that it "looks the same" from different places. 

Let us assume, for example, that entities of type network represent 
elements of a discrete group that is spawned by two generators, and 
the entries in Links [|a,b,a_inv,b_inv|] are the elements that are reached 
by left-application of the group generators A, B, or their inverses.


How would one write a function that counts the sites in such a network? 
With proper EQ hash tables, it's quite easy.

-- 
regards,               tf@cip.physik.uni-muenchen.de              (o_
 Thomas Fischbacher -  http://www.cip.physik.uni-muenchen.de/~tf  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)