export const copy = edges => nodes(edges).reduce(addNodeBin, asMap(edges));
export const adj = edges => src => asMap(get(edges)(src));
export const addNodeBin = (edges, src) => addMap(edges)(src)(asMap(get(edges)(src)));
export const nodes = edges => spreadK(asMap(edges));
export const resetNodeBin = (edges, src) => addMap(edges)(src)(asMap());
export const mergeEdgesBin = (edges, alts) =>
 spread(asMap(alts)).reduce(importEdgeBin, edges);
export const disconnectNodeBin = (edges, src) =>
  neighborPairs(edges)(src).reduce(removeEdgeBin, asMap(edges));
export const removeEdgeBin = (edges, [ src, nb, ]) => [
  [ src, removeMap(get(edges)(src))(nb) ],
  [ nb, removeMap(get(edges)(nb))(src) ]].reduce(addBinMap, asMap(edges));
export const addEdgeBin = (edges, [ src, nb, wt = 0 ]) => [
  [ src, addMap(get(edges)(src))(nb)(wt) ],
  [ nb, addMap(get(edges)(nb))(src)(wt) ],].reduce(addBinMap, asMap(edges));