Expected behavior of "deriving Ord"?

Christian Maeder Christian.Maeder at dfki.de
Thu Mar 20 14:00:46 EDT 2008


Conal Elliott wrote:
> AddBounds makes total orders from total orders.  It just adds new least
> and greatest elements.
> 
> The problem with the derived instance is that it doesn't exploit the
> potential laziness of min on 'a'.  Because of their types, min it can
> produce partial info from partial info and (<=) and compares cannot.

Right, I've mixed up partial orders, partial (infinite?) values as input
to total order functions. I could not construct an example, though.

 min (NoBound MinBound) (NoBound (NoBound undefined))

worked using ghci.

Cheers Christian


More information about the Glasgow-haskell-users mailing list