Using the following definitions:
lenDigits n = length (show n) factorial n = product [1..n]
I evaluate the following
Prelude> ((lenDigits . factorial) 199) <= 199 False Prelude> (\i -> ((lenDigits . factorial) i) <= i) 199 True
What is the reason for such behaviour? As I see it, the first expression is just the same as the second expression with the lambdas reduced.
Because in the first expression the first 199
has type Integer
and the second has Int
. But in the second expression both have type Int
and factorial 199
can't be represented by the type Int
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With