title: Inconsistent types for record fields
body: <p>After reading around a bit, it seems that the current record situation in Haskell is a bit sticky. </p>
  
  <p>Take, for example, the <code>StateT</code> newtype. Both <a href="http://hackage.haskell.org/package/transformers-0.3.0.0/docs/src/Control-Monad-Trans-State-Lazy.html#StateT" rel="nofollow">the code</a></p>
  
  <pre><code>newtype StateT s m a = StateT { runStateT :: s -&gt; m (a,s) }
  </code></pre>
  
  <p>and <a href="http://hackage.haskell.org/package/mtl-2.1.2/docs/Control-Monad-State-Lazy.html" rel="nofollow">the docs</a></p>
  
  <blockquote>
    <p><strong>Constructors</strong></p>
    
    <p><code> <strong>StateT</strong></code></p>
    
    <p><code>   <strong>runStateT :: s -> m (a, s)</strong></code></p>
  </blockquote>
  
  <p>say that the type of <code>runStateT</code> is <code>s -&gt; m (a,s)</code>. However, GHCi show that the type <em>really</em> is</p>
  
  <pre><code>&gt; :t runStateT
  runStateT :: StateT s m a -&gt; s -&gt; m (a,s)
  </code></pre>
  
  <p>Is there any explanation for this discrepancy? Do the identifier in the record and the function refer to two different things, which GHC magically resolves behind the scenes? Although I see why it is nice to write <code>s -&gt; m (a,s)</code> in the record, it just seems <em>wrong</em>.</p>