Without $ priority works as follows:
maximum . map product . (groupsOf 5 x)
So how . (function composition) takes two functions as arguments, and groupsOf 5 x cannot return the function, this is an error.
With $ , priority works as follows:
(maximum . map product . groupsOf 5) x
This is equivalent (via composition of functions):
maximum (map product (groupsOf 5 x))
or
maximum $ map product $ groupsOf 5 x
(however, a line along $ , as it is considered bad style)
This has nothing to do with laziness, please note.
bdonlan
source share