title: Why is function composition in Haskell right associative?
body: <p>Mathematically the function composition operation is associative. Hence:</p>
  
  <pre><code>f . (g . h) = (f . g) . h
  </code></pre>
  
  <p>Thus the function composition operation may be defined to be either left associative or right associative.</p>
  
  <p>Since normal function application in Haskell (i.e. the juxtaposition of terms, not the <code>$</code> operation) is left associative in my opinion function composition should also be left associative. After all most people in the world (including myself) are used to reading from left to right.</p>
  
  <p>Nevertheless function composition in Haskell is right associative:</p>
  
  <pre><code>infixr 9 .
  </code></pre>
  
  <p>I know that it doesn't really make a difference whether the function composition operation is left associative or right associative. Nevertheless I'm curious to know why is it not left associative. Two reasons come to my mind for this design decision:</p>
  
  <ol>
  <li>The makers of Haskell wanted function composition to be logically as similar as the <code>$</code> operation.</li>
  <li>One of the makers of Haskell was a Japanese who found it more intuitive to make function composition right associative instead of left associative.</li>
  </ol>
  
  <p>Jokes aside, is there any beneficial reason for function composition to be right associative in Haskell? Would it make any difference if function composition in Haskell was left associative?</p>