[Haskell-cafe] Style

Chaddaï Fouché chaddai.fouche at gmail.com
Sun Aug 26 19:34:52 EDT 2007


2007/8/26, Yitzchak Gale <gale at sefer.org>:
> True, that is not the problem.
>
> Using length forces the result to
> be Int, which is different than all of
> the other tm's so far. So for example,
> try this:
>
> [n | n <- [0..25], tm_silly n /= tm n]
>

You mean to say that tm_silly returns Int, which means we can't use it
directly in a comparison but have to use toInteger or fromInteger ?
Ok, in this case, but it's still a nice test for our more optimized
functions (and using genericLength is much slower than toInteger .
length, though of course the results differ for really long list)

$> [n | n <- [1..1000], toInteger (tm_silly n) /= tm n]
[]

-- 
Jedaï


More information about the Haskell-Cafe mailing list