In the following snippet, you can see my two collatz functions I wrote in Haskell. For the recursive application I used parentheses in the first example (collatz) to get the
As @missingno stated, it's an operator precedence problem. You could rewrite it like this
collatz' n | even n = n : (collatz' $ n `div` 2) | otherwise = n : (collatz' $ n * 3 + 1)
But that obviously doesn't buy you much, because you still have parenthesis.