Simon, thanks a lot. You write:
I don't think you can avoid this. You have two type constructors:
class SortedList s a where ...
class FiniteMap m k a where ...
s has kind *->*
m has kind *->*->*
You want to say
instance SortedList s (Pair k a) => FiniteMap m k a where...
but there's a relationship between s and m, namely
m k a = s (Pair k a)
That is the relationship your MkFinMap states.
I don't know how to improve on this... except to give sortedList a
key and a value.
I was afraid of that. One of the things I tried was eliminating one
of the type constructors on FiniteMap, but I found the types getting
hopelessly confused (i.e., ambiguous). I think my intuition, or my
hope for a "cleaner" solution, is just plain wrong.
You don't need class ZeroVal.. just use 'undefined' instead.
Thanks --- I had forgotten that.
Dave Barton <*>
[EMAIL PROTECTED] )0(
http://www.averstar.com/~dlb