title: Anybody can explain this error? Couldn't match type `Integer'
body: <p>I'm trying to learn haskell and there is a particular error that I'm not able to figure out.</p>
  
  <pre><code>robot (_name,_attack,_hp) = \ cmd -&gt; cmd (_name,_attack,_hp)
  
  hp (_,_,h) = h
  getHp aRobot = aRobot hp
  
  setHp aRobot newHp = aRobot (\ (n,a,_) -&gt; robot (n,a,newHp))
  
  damage aRobot amount = let actualHp = getHp aRobot
                          in
                          setHp aRobot (actualHp - amount)
  
  
  makeKiller = robot ("Killer",10,200)
  makeBetty = robot ("Betty",5,300)
  
  ----- Example of computation in ghci
  
  b = makeBetty
  b1 = damage b 34 
  
  &lt;interactive&gt;:52:14: error:
      * Couldn't match type `Integer'
                       with `(([Char], Integer, t1) -&gt; t0) -&gt; t0'
        Expected type: (([Char], Integer,
                         (([Char], Integer, t1) -&gt; t0) -&gt; t0)
                        -&gt; (([Char], Integer, t1) -&gt; t0) -&gt; t0)
                       -&gt; t1
          Actual type: (([Char], Integer, Integer) -&gt; t1) -&gt; t1
      * In the first argument of damage, namely `b'
        In the expression: damage b 34
        In an equation for `b1': b1 = damage b 34
      * Relevant bindings include b1 :: t1 (bound at &lt;interactive&gt;:52:1)
  </code></pre>
  
  <p>There is something in the damage function that's wrong, can anyone explain the error to me please?</p>
  
  <p>Thank you in advance!</p>