title: Partially Applied Types in Haskell
body: <p>Based on <a href="https://stackoverflow.com/q/23895891/2118130">this</a> question, in this code</p>
  
  <pre><code>data Promise a b =  Pending (a -&gt; b) | Resolved b | Broken
  
  instance Functor (Promise x) where
      fmap f (Pending g) = Pending (f . g)
  </code></pre>
  
  <hr>
  
  <p><strong>IF</strong></p>
  
  <pre><code>g :: a -&gt; b
  </code></pre>
  
  <p><strong>then</strong></p>
  
  <pre><code>Pending g :: Promise a b
  </code></pre>
  
  <p><strong>also</strong></p>
  
  <pre><code>f :: b -&gt; c
  </code></pre>
  
  <p>because of the existence of <code>f . g</code>.</p>
  
  <p><strong>That means</strong> </p>
  
  <pre><code>Pending (f . g) :: Promise a c`.
  </code></pre>
  
  <p><strong>Wrapping up</strong></p>
  
  <pre><code>fmap :: (b -&gt; c) -&gt; Promise a b -&gt; Promise a c
  </code></pre>
  
  <hr>
  
  <p>Now <code>fmap</code> alone has this signature (adapted to the above)</p>
  
  <pre><code>fmap :: Functor f =&gt; (b -&gt; c) -&gt; f b -&gt; f c
  </code></pre>
  
  <p>This only conforms if you assume that <code>f = Promise a</code>. While the end product seems reasonable, how do you interpret the type of <code>f</code> or equivalently what it the type of a partially applied promise <code>Promise a</code>?</p>