[Haskell-cafe] Why does Enum succ and pred functions throw exception
alex.solla at gmail.com
Fri Jun 22 21:40:33 CEST 2012
On Thu, Jun 21, 2012 at 5:36 PM, Richard O'Keefe <ok at cs.otago.ac.nz> wrote:
It always struck me as odd that Enum doesn't extend Ord.
> There's a reason given for not having Bounded extend Ord,
> which doesn't really apply to a class having fromEnum :: a -> Int.
> Testing whether an enum bound is at a limit is thus a bit tricky.
An ordering does not typically induce a computable enumeration. For
example, there are infinitely many rationals between any pair of rationals.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe