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

[refined4s-core] Add CanBeOrdered for providing Ordering and Conversion[Type, Ordered[Type]] #196

Closed
kevin-lee opened this issue Dec 29, 2023 · 0 comments · Fixed by #197
Assignees
Labels
Milestone

Comments

@kevin-lee
Copy link
Owner

Summary

[refined4s-core] Add CanBeOrdered for providing Ordering and Conversion[Type, Ordered[Type]]

Version

0.6.0

Description

import refined4s.*

type MyNum = MyNum.Type
object MyNum extends Newtype[Int]
val input1 = MyNum(1)
val input2 = MyNum(2)

Ordering[MyNum].compare(input1, input2)
// Int = -1

(input1: Ordered[MyNum]).compare(input2)
// Int = -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant