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

Upgrade scalalib to 11.3.0 #585

Closed
wants to merge 1 commit into from
Closed

Upgrade scalalib to 11.3.0 #585

wants to merge 1 commit into from

Conversation

isaacl
Copy link
Member

@isaacl isaacl commented Oct 15, 2024

Fix timestamper by renaming method.

Fix timestamper by renaming method.
@isaacl isaacl requested a review from lenguyenthanh October 15, 2024 12:38
@isaacl
Copy link
Member Author

isaacl commented Oct 15, 2024

Let's keep this in draft until we're sure we can use 11.3.0 scalalib.

@@ -3,12 +3,12 @@ package chess
opaque type Timestamp = Long
object Timestamp extends OpaqueLong[Timestamp]:
extension (t: Timestamp)
def -(o: Timestamp): Centis = Centis.ofMillis(t - o.value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove custom operators from scalalib instead? It'll leads to less surprised. We can re-add it if we needed in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I am not sure what is best. It seems odd to me that OpaqueInt is special cased with methods. But you could go the other way, and rename it to RichOpaqueInt leaving an empty OpaqueInt in its place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason here is Int and Long are not symmetrical. We use Int arithmetic much more than Long. If we use Long arithmetic that much, we already add them.

@isaacl isaacl closed this Oct 17, 2024
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