Perfect numbers: Difference between revisions

Line 977:
Note that the filter function, though convenient and well optimised, is not strictly necessary.
We can always replace it with a more general monadic bind (chain) function, which is essentially just concat map
(Monadic return/inject for lists is simply lambda x --> [x], inlined here, and fail is [].)
 
<lang JavaScript>(function (nFrom, nTo) {
9,655

edits