Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Note that the argument, the list to be sorted, is pattern matched as

    (p:xs)
which means that p is the first element of the list, and xs is the rest of the elements (i.e., xs does not contain p). In the definition of "greater":

    greater = filter (>= p) xs
, the filter is applied to xs, which means that p will not be included.


Ah, I see. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: