Subsumption in partially ordered sets
Tom.Pledger at peace.com
Tue Nov 18 09:14:07 EST 2003
Graham Klyne writes:
| Below is some code I have written, which works, but I'm not sure
| that it's especially efficient or elegant. Are there any published
| Haskell libraries that contain something like this?
Partially ordered sets are in cahoots with lattices, so you may be
interested in http://www.cse.ogi.edu/~mpj/pubs/lattices.html .
And here's some off-the-cuff feedback...
How about using Maybe Ordering, instead of a new data type?
(As in http://firstname.lastname@example.org/msg05635.html)
Instead of hard-wiring Maybe into the element type in dropSubsumed,
how about passing in a partial comparison function?
dropSubsumedBy :: (a -> a -> Maybe Ordering) -> [a] -> [a]
More information about the Haskell-Cafe