Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecExpr Deref/DerefMut=[L]. also convenience methods and trait impls #325

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

mtak-
Copy link
Contributor

@mtak- mtak- commented Jul 29, 2024

I believe the current API of RecExpr already constrains the impl enough to go ahead and add Deref/DerefMut = [L]. I could instead add len/iter/iter_mut and still get most of the benefits of Deref/DerefMut.

I also added FromIterator, AsMut, Borrow, BorrowMut, and IntoIterator impls, and a couple of convenience methods. items solves the issue of expr.as_ref().iter().enumerate() followed by Id::from(idx)

I went ahead and changed the source to take advantage of these additions. Let me know if you would like me to scale this pr back.

…, IntoIterator. also add ids, and items convenience methods.
@mwillsey
Copy link
Member

Nice change!

@mwillsey mwillsey merged commit fa40e29 into egraphs-good:main Dec 30, 2024
2 checks passed
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.

2 participants