<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/000cddff1b409b39cd14cc392083ce8a"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-19T17:26:18"
  subject="Defining type that requires hashtables with recursive definition "
  prev="2009/01/15619ef0d6556c727c807856c0540121"
  next="2009/01/0401a4d4b6d02ab9f2278e9afaf7a07b"
  next-in-thread="2009/01/0401a4d4b6d02ab9f2278e9afaf7a07b"
  prev-thread="2009/01/f038b8a453e89bfa6350495a826080fe"
  next-thread="2009/01/ae17c2a5c6ecb959567756983d8095a1"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Defining type that requires hashtables with recursive definition ">
<msg 
  url="2009/01/000cddff1b409b39cd14cc392083ce8a"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-19T17:26:18"
  subject="Defining type that requires hashtables with recursive definition ">
<msg 
  url="2009/01/0401a4d4b6d02ab9f2278e9afaf7a07b"
  from="Jacques Carette &lt;carette@m...&gt;"
  author="Jacques Carette"
  date="2009-01-19T17:35:14"
  subject="Re: [Caml-list] Defining type that requires hashtables with recursive definition">
<msg 
  url="2009/01/eb6831715abd9119a3ef7546f61fe138"
  from="Thomas Gazagnaire &lt;ocaml@g...&gt;"
  author="Thomas Gazagnaire"
  date="2009-01-19T18:09:44"
  subject="Re: [Caml-list] Defining type that requires hashtables with recursive  definition">
<msg 
  url="2009/01/38305d510cdda51c37c02c10a85c4db7"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-19T19:36:38"
  subject="Re: [Caml-list] Defining type that requires hashtables with recursive definition">
</msg>
<msg 
  url="2009/01/579dd5557b1f6515bd0fd1279ff0f1ff"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-20T10:09:33"
  subject="Re: [Caml-list] Defining type that requires hashtables with recursive definition">
</msg>
</msg>
<msg 
  url="2009/01/0d27c84bbbe6b31d05561e311d1288eb"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-19T19:34:41"
  subject="Re: [Caml-list] Defining type that requires hashtables with recursive definition">
</msg>
</msg>
</msg>
</thread>

<contents>
Hello,

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. Note that the idea
is to use object address comparison
for the keys so:

module H =
   struct
     type t = node
     let equal (e1:node) (e2:node) = (==) e1 e2
     let hash (e:node) = Hashtbl.hash e
   end

module J = Hashtbl.Make( H )

However this requires a recursive definition on
the hashtable. How may a declare node and hashtable
to allow this?

TIA,
Hugo F.



</contents>

</message>

