Sieve of Eratosthenes in Haskell
I'd suggest to filter out unneeded elements, instead of replacing them by -1. Keeping and processing all the -1 is unnecessary:

sieve_once :: [Integer] -&gt; Integer -&gt; [Integer]
sieve_once seq p = filter (\x -&gt; x `mod` p /= 0) seq

-- a list of all prime numbers
sieve :: [Integer]
sieve = unfoldr (\(p:rest) -&gt; Just (p, sieve_once rest p)) [2..]