8000 fix: example in CONTRIBUTING.md by illusory0x0 · Pull Request #2288 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: example in CONTRIBUTING.md #2288

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 17, 2025

Conversation

illusory0x0
Copy link
Contributor

define both method and function syntac has been deprecated.

Copy link
peter-jerry-ye-code-review bot commented Jun 17, 2025
Documentation update for generic function syntax

Category
Maintainability
Code Snippet

  • fn map[A,B](self : Array[A], f : (A) -> (B)) -> Array[B]
  • fn[A,B] Array::map(self : Array[A], f : (A) -> (B)) -> Array[B]
    Recommendation
    The change is correct. Consider adding a note explaining that the old syntax is deprecated to help developers update their existing code.
    Reasoning
    Clear documentation of syntax changes helps developers maintain and update their code. Adding a deprecation notice would help with the transition.
Missing example for non-method function syntax

Category
Maintainability
Code Snippet
fn[A,B] Array::map(self : Array[A], f : (A) -> (B)) -> Array[B]
Recommendation
Add an example of a regular (non-method) function with generic parameters to show both cases:

fn[A] identity(x: A) -> A

Reasoning
Since the pull request message mentions both method and function syntax changes, the documentation should show examples of both forms for completeness.

Inconsistent documentation structure

Category
Maintainability
Code Snippet

  • type parameters, one character starting from A is preferred, e.g,
    Recommendation
    Add bullets or numbering for all examples consistently. Consider using a more structured format like:
  • Type parameters (single character)
    • Example: A, B, C
  • Exceptions
    • Example: K,V for Maps
      Reasoning
      Consistent documentation structure makes it easier to read and understand the conventions.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 7332

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.103%

Totals Coverage Status
Change from base Build 7310: 0.0%
Covered Lines: 8572
Relevant Lines: 9207

💛 - Coveralls

define both method and function syntac has been deprecated.
@peter-jerry-ye peter-jerry-ye merged commit 74b721e into moonbitlang:main Jun 17, 2025
9 of 12 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.

3 participants
0