I'm sure something like this has come up here before, but I've just
been banging my head against it, and feel like a mild grouse.

I recently found myself needing a partial order class, and found that:

        The most likely-looking operator symbols are all "taken";
        
        It'd be desirable to have such a class be a superclass of
        Ord, but this isn't possible without hacking the Prelude;
        
        It's not possible to have an instance declaration making
        all total orders also partial orders.

The net result means that the class seems more trouble to define
and maintain than its worth.  Has anyone run into this before,
come up with a "fix" in Haskell 1.4, or come up with a concrete
suggestion which might make it into ["Standard"] Haskell [1.5]?

Off the top of my head, it looks like a PartOrd class in the Prelude,
and a Jones, P-J and Meijer-style generalisation of instance
declarations would do the trick.

Cheers,
Alex.



Reply via email to