wikipediaを見てエラトステネスの篩を実装して見たのだけど、、
http://ja.wikipedia.org/wiki/エラトステネスの篩

うまく行かないです>.<
何がいけないのでしょうか?

step2 (pL, sL) = step3 (pL ++ [head sL], tail sL)
step3 (pL, sL) = step4 (pL, filter (\x -> x `mod` (last pL) /= 0) sL)
step4 (pL, sL) = if (tail sL) < (tail pL)^2
then (pL ++ sL, [])
else step2 (pL, sL)

main = print $ step2 ([], [2..20])