
19 Jul
2011
19 Jul
'11
2:20 a.m.
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 ($).