graphite icon indicating copy to clipboard operation
graphite copied to clipboard

Unnecessary constraints in the `Graph` class

Open fiedlerp opened this issue 5 years ago • 1 comments

The constraints (Hashable v, Eq v) for methods of the Graph class are totally unnecessary. These constraints are implementation-specific for UGraph and DGraph, so the constraints should be moved to instances of the Graph.

instance (Hashable v, Eq v) => Graph (Graph v e) where ...

Of course, the Eq v makes sense at some of the methods (e.g. removeVertex) but definitely not all.

fiedlerp avatar Sep 14 '20 09:09 fiedlerp

Totally agree, will try and refactor that as soon as I have the time. If you'd like to try a PR for this though, it's welcome :) if not I'll try to make time for this soon, it's been stalled sadly

alx741 avatar Sep 19 '20 22:09 alx741