List functions - "Under" operations

ajb at spamcop.net ajb at spamcop.net
Sat Jan 17 10:00:23 EST 2004


G'day all.

Quoting Tomasz Zielonka <t.zielonka at students.mimuw.edu.pl>:

> It doesn't work when the type Foo doesn't belong to Ord class.

Right.

> There is a simple technique which helped me when I wanted to make a
> priority queue of elements with Double key, and IO () value.  I wanted
> to use something from Edison, but most of relevant data structures
> didn't distinguish key from value and insisted that element type belong
> to Ord class.

Yes.  Edison priority queues are collections, not associations.  This
is a sufficiently common case that this might be worth thinking about
for those working on a new collection system.

> I just introduced a wrapper type that provides a trivial "Egalite"
> ordering.

Just added this to PreludeExts, though I called it OrdWrapper.  (NoOrd
suggests that it doesn't support Ord, whereas it's the underlying
type which doesn't support Ord, or at least, you want to suppress its
default Ord behaviour.)

Cheers,
Andrew Bromage


More information about the Libraries mailing list