I'm trying to implement a data structure where if I had the use of infinity for numerical comparison purposes, it would simply things greatly. Note this isn't maxBound/minBound, because a value can be <= maxbound, but all values would be < infinity.
No hope?
Well how about that! It turns out if you just type 1/0
it returns Infinity
! On ghci:
Prelude> 1/0 Infinity Prelude> :t 1/0 1/0 :: (Fractional t) => t Prelude> let inf=1/0 Prelude> filter (>=inf) [1..]
and then of course it runs forever, never finding a number bigger than infinity. (But see ephemient's comments below on the actual behavior of [1..]
)
infinity = read "Infinity"
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