title: Could match expect type when applying functions to a tree structure
body: <p><a href="https://i.stack.imgur.com/kqNeq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kqNeq.png" alt="enter image description here"></a></p>
  
  <pre><code>data Forky a = Tip a | Branch (Forky a) (Forky a)
      deriving (Eq, Show)
  
  instance Functor Forky where
      -- fmap :: (a -&gt; b) -&gt; Forky a -&gt; Forky b
      fmap f (Tip a) = Tip (f a)
      fmap f (Branch left right) = Branch (fmap f left) (fmap f right)
  
  instance Applicative Forky where
      -- pure :: a -&gt; Forky a
      pure a = Tip a
  
      -- (&lt;*&gt;) :: Forky (a -&gt; b) -&gt; Forky a -&gt; Forky b
      (&lt;*&gt;) (Branch f g) (Branch left right) = 
          Branch ((fmap f (Branch left right)) (fmap g (Branch left right)))
  </code></pre>
  
  <p>Everything looks good until the last function <code>(&lt;*&gt;)</code></p>
  
  <p>The error tells </p>
  
  <pre><code> ? Couldn't match expected type ‘a -&gt; b0’
                    with actual type ‘Forky (a -&gt; b)’
  </code></pre>
  
  <p>How can I fix it? Thank you!</p>