title: Haskell function composition, type of (.)(.) and how it's presented
body: <p>So i know that:</p>
  
  <pre><code>(.) = (f.g) x = f (g x)
  </code></pre>
  
  <p>And it's type is (B->C)->(A->B)->A->C
  But what about:</p>
  
  <pre><code>(.)(.) = _? = _?
  </code></pre>
  
  <p>How this is represented? I thought of:</p>
  
  <pre><code>(.)(.) = (f.g)(f.g)x = f(g(f(g x))) // this
  (.)(.) = (f.g.h)x = f(g(h x)) // or this
  </code></pre>
  
  <p>But as far as i tried to get type of it, it's not correct to what GHCi tells me.
  So what are both "_?"</p>
  
  <p>Also - what does function/operator <strong>$</strong> do?</p>