8000 refactor: update documentation and deprecate outdated functions across multiple files by bobzhang · Pull Request #2292 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: update documentation and deprecate outdated functions across multiple files #2292

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 1 commit into from
Jun 18, 2025

Conversation

bobzhang
Copy link
Contributor

No description provided.

Copy link
Inconsistent type annotation in example code

Category
Maintainability
Code Snippet
let iter : Iter[Int]= Iter::empty()
Recommendation
Add space after type annotation colon: let iter : Iter[Int] = Iter::empty()
Reasoning
Consistent spacing improves readability and should follow style guidelines. The space after type annotation colon is missing.

Retained deprecated function documentation

Category
Maintainability
Code Snippet
pub fn[A] T::rev_fold(self : T[A], init~ : B, f : (B, A) -> B) -> B
Recommendation
Remove all documentation comments for deprecated functions consistently, as done with other deprecated functions in this PR
Reasoning
Having documentation for deprecated functions can be misleading for developers. The PR removes docs for other deprecated functions but missed this one.

Inconsistent tuple example naming pattern

Category
Maintainability
Code Snippet
let tuple2 = ((pair : (Int, Int)) => (pair.0 + 1, pair.1))(tuple)
Recommendation
Use a more descriptive name like incremented_first instead of tuple2 to indicate the transformation
Reasoning
Generic names like tuple2, tuple3 don't convey the meaning of the transformation. Using descriptive names helps readers understand the purpose of each example.

@bobzhang bobzhang merged commit 3f5bc0d into main Jun 18, 2025
11 of 12 checks passed
@bobzhang bobzhang deleted the hongbo/update_docs branch June 18, 2025 01:45
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
0