(primes :: [Word8]) doesn't work. It's an Integral type allowed by the library, but it produces outright wrong results. The library should probably ensure that the type used for calculations is enough to correctly compute all results in the return domain.