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

haskell, infinity

Solution

Maybe you want a Maybe type?

data Infinite a = Infinite | Only a

then write a Num instance for Num a => Infinite a, with the numeric rules you need.

Problem

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?

Original source