Skip to content

Make all_edges public and give it a real iterator - #192

Merged
mtfishman merged 2 commits into
mainfrom
mf/all-edges-iterator
Aug 29, 2026
Merged

mtfishman merged 2 commits into
mainfrom
mf/all-edges-iterator

Conversation

@mtfishman

@mtfishman mtfishman commented Aug 29, 2026 •

Copy link
Copy Markdown
Member

Summary

all_edges returned a flattened lazy map, so its element type was Any and its length threw, and it was undocumented and unexported despite two dependent packages calling it. It now returns a lazy iterator keeping both, is narrowed to named graphs, and is exported. Also strengthens the edge_subgraph test from #175.

Gives `all_edges` on an undirected graph a lazy iterator instead of a flattened lazy `map`, so its element type and length survive. The flatten inferred `eltype` as `Any` and threw on `length`, which broke callers dispatching on the element type.
`all_edges` never needed a generic graph, so it moves to `NamedGraphs` proper alongside the other named-graph functions, and both edge iterators tighten to named types. Two dependent packages call it, so it is documented and exported rather than reached for as an internal.
@mtfishman mtfishman changed the title Give all_edges an iterator so its eltype and length survive Make all_edges public and give it a real iterator Aug 29, 2026
@mtfishman
mtfishman merged commit f621c61 into main Aug 29, 2026
19 checks passed
@mtfishman
mtfishman deleted the mf/all-edges-iterator branch August 29, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant