I'm reading a piece by Bartosz Milewski wherein he defines the following function:
instance Applicative Chan where
pure x = Chan (repeat x)
(Chan fs) <*> (Chan xs) = Chan (zipWith ($) fs xs)
Why is the function application operator in parenthesis? I understand this is normally done in order to use an infix function in prefix notation form, but I don't understand why, in this case, the function couldn't couldn't simply be expressed as Chan (zipWith $ fs xs), and wonder what the difference between the two is.
(if you still need context, refer to the article)
Chan (zipWith id fs xs)? It's exactly the same as the current implementation.($)isn't some magical primitive operator: it's a function just like(+)andor.