title: Haskell: read and type signatures
body: <p><code>read</code> is defined in the Prelude as</p>
  
  <pre><code>read :: (Read a) =&gt; String -&gt; a
  </code></pre>
  
  <p>and can be used as e.g. <code>read "1" :: Int</code>. </p>
  
  <p>Now a function</p>
  
  <pre><code>readOne :: (Read a) =&gt; [String] -&gt; (a, [String])
  readOne (x:xs) = (read x,xs)
  </code></pre>
  
  <p>used with <code>readOne ["1","foo"]</code> results (as expected) in the error</p>
  
  <p><code>
  Ambiguous type variable 'a' in the constraint: <br />
  'Read a' arising from a use of 'readOne' at :1:0-18 <br />
  Probable fix: add a type signature that fixes these type variable(s)
  </code></p>
  
  <p>But <code>readOne ["1","foo"] :: Int</code> doesn't work, while</p>
  
  <pre><code>readOneInt :: [String] -&gt; (Int, [String])
  readOneInt = readOne
  </code></pre>
  
  <p>works just fine:</p>
  
  <pre><code>&gt; readOneInt ["1", "foo"]
  (1,["foo"])
  </code></pre>
  
  <p>So: how can I add a type signature to <code>readOne</code> without defining a new function like <code>readOneInt</code>?</p>