[Haskell-cafe] question regarding the $ apply operator

Arlen Cuss celtic at sairyx.org
Tue Jul 19 08:20:04 CEST 2011


> applySkip i f ls = (take i) ls ++ f (drop i ls)
> 
> But the following doesn't:
> 
> applySkip i f ls = (take i) ls ++ f $ drop i ls

The issue is with operator precedence. The above is equivalent to:

> applySkip i f ls = ((take i) ls ++ f) (drop i ls)

(++) binds more strongly than ($).



More information about the Haskell-Cafe mailing list