title: Why does Haskell not have records with structural typing?
body: <p>I have heard Haskell described as having structural typing. Records are an exception to that though as I understand. For example <code>foo</code> cannot be called with something of type <code>HRec2</code> even though <code>HRec</code> and <code>HRec2</code> are only nominally different in their fields.</p>
  
  <pre><code>data HRec = HRec { x :: Int, y :: Bool }
  data HRec2 = HRec2 { p :: Int, q :: Bool }
  
  foo :: HRec -&gt; Bool
  </code></pre>
  
  <p>Is there some explanation for rejecting extending structural typing to everything including records?</p>
  
  <p>Are there statically typed languages with structural typing even for records? Is there maybe some debate on this I can read about for all statically typed languages in general?</p>