So I was working on a way to lazily generate primes, and I came up with these three definitions, which all work in an equivalent way - just checking whether each new intege
Note that primes3 can be made more efficient by changing ps++[x] to (x:ps). The running (++) is linear in the length of its left argument, but constant in the length of the right argument.