At risk of belaboring the now-obvious, note that the empty lists begin
at 1, which is 10^8, and thus the first power of 10 evenly
divisible by 2^8.
The largest value in the list for each 10^n is likewise 0 modulo 2^n.
(Figuring out why the sequence has those particular multiples of 2^n
is
On Thu, 16 May 2013 23:15:33 +0200, you wrote:
>Hello everyone,
>
>I was playing with Word8 and list comprehensions and
>the following examples came up. I have to admit the
>behavior looks quite strange because it does not seem
>to be consistent. Can someone shed some light on reason
>behind some
This happens because of how fromInteger is defined for Word8. It maps
integers to integers mod 256. Also remember that 10 is actually
fromInteger 10, in all of your examples.
So your example is actually equivalent to [0..1 `mod` 256].
On May 16, 2013 2:19 PM, "Jose A. Lopes" wrote:
>
Prelude> 10 `mod` 256
0
So [1..10] == [1..0].
Cheers,
On Thu, May 16, 2013 at 6:15 PM, Jose A. Lopes wrote:
> Hello everyone,
>
> I was playing with Word8 and list comprehensions and
> the following examples came up. I have to admit the
> behavior looks quite strange because it
Hello everyone,
I was playing with Word8 and list comprehensions and
the following examples came up. I have to admit the
behavior looks quite strange because it does not seem
to be consistent. Can someone shed some light on reason
behind some of these outputs?
By the way, I have abbreviated some