f $ g $ h x = f (g (h x))If
f g h x = ((f g) h) xIt is also useful in higher-order situations, such as
$ comes from the Prelude, where it is defined as:
infixr 0 $ ($) :: (a -> b) -> a -> b f $ x = f x
The $ syntax is also used in Template Haskell with an entirely different meaning. If the $ is immediately followed by a letter or a left parenthesis (with no intervening white space), then it is understood by the GHC compiler as a Template Haskell splice and not the infix operator described above. To get the infix operator be sure to separate the $ from the right argument by at least one white space.