by outworlder · 12y ago · 0 comments
This is perfectly nice:
firstBatch = take 10 myDoubles
This is not that nice: sieve (p:ps) xs = h ++ sieve ps [x | x <- t, rem x p /=0] where (h,~(_:t)) = span(< p*p) xs
But that's because there's just too many things going on. A comparable Java code would likely span a page.
I guess, for a trained eye, it is way easier to understand what's going on given those two lines, then a full page program, which would likely hide bugs in side effects.