title: How to determine type of Haskell functions?
body: <p>I have stumbled upon lots of exercises that give you a function and ask for you to deduce the type of each one.</p>
  
  <p>I have the following example. Please note this is not homework that I need to get done. I have the answer to this specific example and provide it below. Maybe someone can help me out in learning how to reason this kind of exercises.</p>
  
  <p>The function:</p>
  
  <pre><code>h1 f g x y = f (g x y) x
  </code></pre>
  
  <p>The supposed type:</p>
  
  <pre><code>h1 :: (a -&gt; b -&gt; c) -&gt; (b -&gt; d -&gt; a) -&gt; b -&gt; d -&gt; c
  </code></pre>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p>I added 27 exercises <a href="http://hpaste.org/72107" rel="noreferrer">here</a> <strong>without solutions</strong>. </p>
  
  <p>Some of them have solutions included <a href="http://hpaste.org/72090" rel="noreferrer">here</a>.
  However, it is possible to know the type by using the GHCi command <code>:t</code></p>