>> To gloss over details: it'll reduce x far enough so it knows that
>> it's an Integer, but it won't nessesarally compute that integers
>> value.

> No, Integers don't contain any lazy components.
> It statically knows that it's an integer.

I meant that it would reduce to the outermost constructor but nessesarally evaluate the rest of the object.

Ok, I actually looked up the implementation of Integer in GHC.

> -- | Arbitrary-precision integers.
> data Integer       
>   = S# Int#                 -- small integers
> #ifndef ILX
>   | J# Int# ByteArray#      -- large integers
> #else
>   | J# Void BigInteger      -- .NET big ints

You were right and I was wrong, Integers contain no lazy components. Perhaps that just highlights the folly of guessing how much actually gets evaluated in a lazy language.. :)

Ben.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to