In Haskell, is there infinity :: Num a => a?

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..])

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)