title: Can you represent a closed network at compile time in F#?
body: <p>I'm wanting to represent a directed network graph that is closed, e.g. where the edges would look like:</p>
  <pre><code>N1-&gt;N2
  N2-&gt;N3
  N3-&gt;N1
  </code></pre>
  <p>Where each node has a predefined number of edges allowed to connect to it. In this case that would be 2, no more, no less.</p>
  <p>I could define a list of nodes and then a list of edges to create the network but I'm wondering if it is possible with F# to define my types in such a way that the compiler would throw an error if the graph was open or one of the nodes had edge connection &lt;&gt; 2?</p>
  <p>I'm not sure this is possible to represent due to the restriction on cyclic dependencies.</p>