|
|
|
|
|
by curtisf
1654 days ago
|
|
I explained why this doesn't work -- what do you do when you combine two heaps with different internal orderings? You need some way to enforce that the orderings are the _same_. A canonical ordering per type is how Haskell does it; dependent types are a more complicated alternative method. |
|
> Instead of MaxHeap(T), make it MaxHeap(T, Ord:(T,T)->bool)
as saying the kind of MaxHeap should be, in Coq syntax, (forall (T : Set), (T -> T -> Bool)). I think this doesn't add any additional complexity vs DataKinds since the function doesn't need to be evaluable at typechecking time, just unified against at construction-time.