title: Haskell data type that represents valid types
body: <p>Is there a library that defines a data type that defines valid Haskell types (presumably this would be a GADT).</p>
  
  <p>To explain, let me suggest what this might look like:</p>
  
  <pre><code>data A
  data B
  
  class Free t
  instance Free A
  instance Free B
  
  x = Forall A (Forall B (Constraint (NumConstraint A) 
        (Constructor Function A (Constructor Function B A))))
  </code></pre>
  
  <p>This would represent:</p>
  
  <pre><code>forall a b. Num a =&gt; a -&gt; b -&gt; a
  </code></pre>
  
  <p>I'm not saying what I've suggested is a good implementation, I'm just trying to show what I mean.</p>
  
  <p>Surely, if you can define the grammar of a type definition, you can create a GADT to represent it. Is there anything that already does this?</p>