In Haskell, operators are just normal functions that have names consisting of characters and use the default infix. You can use them in the same way as a regular identifier, enclosing them in parentheses:
λ> :t (+) (+) :: Num a => a -> a -> a
$ is just an operator like this. It is a function application and is defined as follows:
f $ x = fx
You can get its type in the same way as (+) :
λ> :t ($) ($) :: (a -> b) -> a -> b
Haskell operators can also be partially applied as normal functions, wrapping them in parentheses with one-way arguments. For example,
(+ 1) matches
\ x -> x + 1 , and
(1 +) matches
\x -> 1 + x .
This also applies to $ , so ($ fst client) matches \ f -> f $ fst client or just \ f -> f (fst client) . The code snippet has checks if any of the function lists returns true given the fst client .
source share