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

feat: add Compare::max and Compare::min #1794

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

illusory0x0
Copy link
Contributor

No description provided.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 5708

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 92.569%

Changes Missing Coverage Covered Lines Changed/Added Lines %
builtin/traits.mbt 0 6 0.0%
Totals Coverage Status
Change from base Build 5706: -0.09%
Covered Lines: 6029
Relevant Lines: 6513

💛 - Coveralls

@bobzhang
Copy link
Contributor

@illusory0x0 we have a high bar when adding new traits or modify existing traits, can you elaborate why it is needed, does it justify?

@illusory0x0
Copy link
Contributor Author

@illusory0x0 we have a high bar when adding new traits or modify existing traits, can you elaborate why it is needed, does it justify?

test {
  let x = 132
  let y = 2323
  let z = 2323 
  String::max(x, y) |> ignore // use monomorphic functions would help type infer
  (@math.maximum : (Int,Int) -> Int)(x,y) |> ignore

  x.max(y) |> ignore // infix syntax
  @math.maximum(x,y) |> ignore // prefix syntax

  x.max(y).max(x) |> ignore // easy to writing and avoid nesting
  @math.maximum(x,@math.maximum(y,z)) |> ignore
}

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