Verizon / quiver

A reasonable library for modeling multi-graphs in Scala

Home Page:http://verizon.github.io/quiver/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is fold useful?

stew opened this issue · comments

I would expect fold to visit every node and show you all incoming and outgoing adjacencies for each node. but it seems to only show you an adjacency on on side or the other but not both.

I instead find myself having to iterate over all the nodes and decomp each.

Can fold work this latter way?

fold takes a function f of type (Context[N,A,B], C) => C and then splits the graph into a context c and the remaining graph g. It passes c to your function f and then recurses on g. It's important to note that the vertex in c does not exist in g.

Some other functions of the library rely on this behaviour.

I think what you actually want to fold is the list g.rep.values. We could add a convenience for that. Also, I think we should improve the documentation of fold, select, and contexts.