Currently you define MaxPQueue as wrapper around MinPQueue. I would prefer a general PQueue data type with a type parameter that chooses between the Min and Max variant.
That would save the wrapper code in Data.PQueue.Max and code duplication in custom utility functions.
I think it can still be Haskell 98 with definitions like these:
class Dir dir where dirCompare :: (Ord a) => dir -> a -> a -> Ordering
data Min = Min; instance Dir Min where dirCompare Min = compare
data Max = Max; instance Dir Max where dirCompare Max = flip compare
Currently you define
MaxPQueueas wrapper aroundMinPQueue. I would prefer a generalPQueuedata type with a type parameter that chooses between the Min and Max variant.That would save the wrapper code in
Data.PQueue.Maxand code duplication in custom utility functions.I think it can still be Haskell 98 with definitions like these: