I've continually wanted a "non-destructive" map and fold operation for graphs. As an example of what I mean, let's say I want to create a list of the degrees of each node. What makes sense to me is the following:
add c xs = deg' c : xs
ufold add [] myGraph
But unfortunately, this will only count edges once, whereas I want them counted once for each node they are connected to, rather than just the first one that is matched off in the ufold.
Am I missing something here or has this confused other people too?