swap package:algebraic-graphs

Swap the parts of a given graph. Complexity: O(1) time and memory.
swap empty            == empty
swap . leftVertex     == rightVertex
swap (vertices xs ys) == vertices ys xs
swap (edge x y)       == edge y x
swap . edges          == edges . map Data.Tuple.swap
swap . swap           == id