title: Haskell: Types of function composition not matching
body: <p>I am having some troubles with function composition and types.
  I would like to compose <code>filter</code> (which returns a list) with <code>len</code>, which takes a list as an argument (technically a <code>Foldable</code> but I am simplifying here). 
  Looking at the types everything is as expected:</p>
  
  <pre><code>&gt; :t length
  length :: Foldable t =&gt; t a -&gt; Int
  
  &gt; :t filter
  filter :: (a -&gt; Bool) -&gt; [a] -&gt; [a]
  </code></pre>
  
  <p>So now I would expect the type of <code>(len . filter)</code> to be</p>
  
  <pre><code>(length . filter) :: (a -&gt; Bool) -&gt; [a] -&gt; Int
  </code></pre>
  
  <p>while in reality is</p>
  
  <pre><code>&gt; :t (length . filter)
  (length . filter) :: Foldable ((-&gt;) [a]) =&gt; (a -&gt; Bool) -&gt; Int
  </code></pre>
  
  <p>So it seems I lost some arguments. Is it included in the the <code>Foldable</code> requirements in some way I am not understanding?</p>
  
  <p>Note that everything works as expected if I do partial application:</p>
  
  <pre><code>&gt; let myFilter = filter odd
  &gt; :t myFilter
  myFilter :: Integral a =&gt; [a] -&gt; [a]
  &gt; :t (length . myFilter)
  (length . myFilter) :: Integral a =&gt; [a] -&gt; Int
  &gt;  (length . myFilter) [1,2,3]
  2
  </code></pre>