Open dmwit opened 4 years ago
On the more constructive side: I think the fixes available here are basically the same as the fixes available there. One is to add something like
-- | Honor system. Only make an instance if there are infinitely many inhabitants of your type.
class Infinite a
and then make range :: Infinite k => TMap k v -> Set v
and instance (Infinite k, Ord k, DetectableZero v) => DetectableZero (TMap k v)
essentially without changing the implementations. (Just tweak the M.null
check in DetectableZero
to the commented-out all
check.) The other is to actually iterate over the entire domain; e.g. using the Finite
class from the universe
package (still essentially the honor system).
I think for basically the same reasons
range
can't work (see issue #7),DetectableZero
can't work. Some examples to consider: