title: succ in Haskell: ambiguous type variable
body: <p>I want to write a function mapsucc that produces the successor of every item in a list. Easy enough:</p>
  
  <pre><code>    mapsucc xs = map succ xs
  </code></pre>
  
  <p>works perfectly. I think I could use Currying to make this definition even shorter:</p>
  
  <pre><code>    mapsucc = map succ
  </code></pre>
  
  <p>but I get:</p>
  
  <pre><code>No instance for (Enum b0) arising from a use of ‘succ’
  The type variable ‘b0’ is ambiguous
  Relevant bindings include
    mapsucc :: [b0] -&gt; [b0] (bound at mapsucc.hs:1:1)
  Note: there are several potential instances:
    instance Enum Ordering -- Defined in ‘GHC.Enum’
    instance Enum Integer -- Defined in ‘GHC.Enum’
    instance Enum () -- Defined in ‘GHC.Enum’
    ...plus six others
  In the first argument of ‘map’, namely ‘succ’
  In the expression: map succ
  In an equation for ‘mapsucc’: mapsucc = map succ
  </code></pre>
  
  <p>Now, it's not clear to me why the curried version should be ambiguous, and why, instead, the one with explicit parameters is not.</p>
  
  <p>Also, if from ghci I declare mapsucc with a let, it works perfectly:</p>
  
  <pre><code>Prelude&gt; let mapsucc = map succ
  Prelude&gt; mapsucc "hello"
  "ifmmp"
  </code></pre>
  
  <p>Same behavior if I redefine succ:</p>
  
  <pre><code>mysucc x = succ x
  </code></pre>
  
  <p>works perfectly, while</p>
  
  <pre><code>mysucc = succ
  </code></pre>
  
  <p>gives the same error:</p>
  
  <pre><code>No instance for (Enum a0) arising from a use of ‘succ’
  The type variable ‘a0’ is ambiguous
  Relevant bindings include
    mysucc :: a0 -&gt; a0 (bound at mapsucc.hs:3:1)
  Note: there are several potential instances:
    instance Enum Ordering -- Defined in ‘GHC.Enum’
    instance Enum Integer -- Defined in ‘GHC.Enum’
    instance Enum () -- Defined in ‘GHC.Enum’
    ...plus six others
  In the expression: succ
  In an equation for ‘mysucc’: mysucc = succ
  </code></pre>
  
  <p>and, again, if I define mysucc in ghci throug a let, it works perfectly:</p>
  
  <pre><code>Prelude&gt; let mysucc = succ
  Prelude&gt; mysucc 3
  4
  </code></pre>