title: how to represent graph data strucutre using edge list in OCaml?
body: <p>I am trying to represent a graph using disjoint union and record. The following code cause a syntax error. How to define two variables when they refer to each other?</p>
  
  <pre><code>type 'a vertex = 
    |Empty
    |Vertex of 'a * 'a list;; (*a tuple consisting of any type of element and a list of vertex*);
  
  let v0 = Vertex(0,[v1]) in
  let v1=Vertex(1,[v0]);;
  </code></pre>
  
  <p>If I revise the code in to:</p>
  
  <pre><code>let rec v0 = Vertex(0,[v1]) and  v1=Vertex(1,[v0]);;
  </code></pre>
  
  <p>I will get v0:</p>
  
  <pre><code>[Vertex (1,
    [Vertex (0,
      [Vertex (1,
        [Vertex (0,
          [Vertex (1,
            [Vertex (0,
              [Vertex (1,
                [Vertex (0,
                  [Vertex (1,
                    [Vertex (0,
                      [Vertex (1,
                        [Vertex (0,
                          [Vertex (1,
                            [Vertex (0,
                              [Vertex (1,
                                [Vertex (0,
                                  [Vertex (1,
                                    [Vertex (0,
                                      [Vertex (1,
                                        [Vertex (0,
                                          [Vertex (1,
                                            [Vertex (0,
                                              [Vertex (1,
                                                [Vertex (0,
                                                  [Vertex (1,
                                                    [Vertex (0,
                                                      [Vertex (1,
                                                        [Vertex (0,
                                                          [Vertex (1,
                                                            [Vertex (0,
                                                              [Vertex (1,
                                                                [Vertex (0,
                                                                  [Vertex (1,
                                                                    [Vertex (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [Vertex
                                                                      (1,
                                                                      [Vertex
                                                                      (0,
                                                                      [...])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])]
  </code></pre>
  
  <p>This appears not what I want...</p>
  
  <p>What is the <strong>best way</strong> to define a graph record containing a list or array of vertex? Obviously I cannot do this:</p>
  
  <pre><code>type graph = {
      vertex_set:array};;
  </code></pre>
  
  <p>I get the following message:</p>
  
  <pre><code>Error: The type constructor array expects 1 argument(s),
         but is here applied to 0 argument(s)
  </code></pre>