Functional composition in haskell
1 answer
Haskell's highest priority is the function application or f a. So
fst . fst ((a, b), a)
analyzed as
fst . (fst ((a, b), a))
which is obviously pointless. You can fix this with an operator $, which is just a functional application with the lowest priority, therefore f $ a == f a.
fst . fst $ ((a, b), a)
Or with some parens
(fst . fst) ((a, b), a)
+8