Skip to content

Switch from BatEnum to Seq #1443

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

Merged
merged 12 commits into from
Jul 17, 2025
Merged

Switch from BatEnum to Seq #1443

merged 12 commits into from
Jul 17, 2025

Conversation

karoliineh
Copy link
Member

@karoliineh karoliineh commented May 3, 2024

A try on switching to the more standard Seq.t in Enum instances where possible as proposed in #1437

Some things that I noticed:

  • Enum.cartesian_product is called product in Seq
  • Enum.uncombine is called unzip (or split) in Seq
  • Enum.fold is called fold_left in Seq
  • There is no corresponding function to Enum.uniq in Seq
  • There is no to_seq in BatHashtbl
  • There is no to_seq_keys in BatHashtbl as in the Ocaml standard library Hashtbl

TODO

@karoliineh karoliineh added the cleanup Refactoring, clean-up label May 3, 2024
@karoliineh karoliineh marked this pull request as draft May 3, 2024 16:38
@karoliineh karoliineh marked this pull request as ready for review May 3, 2024 17:16
@sim642 sim642 self-requested a review May 4, 2024 06:38
@sim642 sim642 linked an issue May 22, 2024 that may be closed by this pull request
3 tasks
@sim642 sim642 mentioned this pull request Sep 26, 2024
3 tasks
@sim642 sim642 marked this pull request as draft November 12, 2024 12:56
@michael-schwarz
Copy link
Member

What is still missing here?

@sim642
Copy link
Member

sim642 commented Dec 17, 2024

What is still missing here?

A new batteries release would allot switching many Hashtbl-related places: ocaml-batteries-team/batteries-included#1135.

@sim642
Copy link
Member

sim642 commented Jan 14, 2025

Batteries 3.9.0 has now been released, so that should allow porting some of the previously problematic places as well.

@karoliineh karoliineh marked this pull request as ready for review January 30, 2025 15:28
@sim642 sim642 added the pr-dependency Depends or builds on another PR, which should be merged before label Jan 31, 2025
@sim642 sim642 self-requested a review February 12, 2025 15:56
@sim642
Copy link
Member

sim642 commented Feb 18, 2025

There's now a conflict with PR #1623 which added a component to IntDomTuple.

@michael-schwarz michael-schwarz removed the pr-dependency Depends or builds on another PR, which should be merged before label Jun 4, 2025
@michael-schwarz
Copy link
Member

@karoliineh: Is this now ready for review?

@karoliineh
Copy link
Member Author

@karoliineh: Is this now ready for review?

Yes

@michael-schwarz michael-schwarz self-requested a review July 17, 2025 12:18
@michael-schwarz
Copy link
Member

Should we add semgrep rules to prevent adding new code that uses BatEnum?

@sim642
Copy link
Member

sim642 commented Jul 17, 2025

Should we add semgrep rules to prevent adding new code that uses BatEnum?

Yes, although I just tried and after these changes the rule still seems to find remaining instances.
Either some couldn't (yet?) easily be switched over, or they have been introduced during the year this has been open.
We should merge this now and then someone can perhaps do another pass. I'll put my semgrep rule in a new draft PR.

@sim642 sim642 added this to the v2.6.0 milestone Jul 17, 2025
@sim642 sim642 removed a link to an issue Jul 17, 2025
3 tasks
@sim642 sim642 merged commit a1e5006 into master Jul 17, 2025
21 checks passed
@sim642 sim642 deleted the enum-to-seq branch July 17, 2025 14:26
sim642 added a commit that referenced this pull request Jul 17, 2025
@sim642 sim642 mentioned this pull request Apr 30, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Refactoring, clean-up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants