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

NotEmptySet to inline class #137

Closed
9 tasks done
Tracked by #140
LVMVRQUXL opened this issue Jul 7, 2023 · 2 comments · Fixed by #148 or #152
Closed
9 tasks done
Tracked by #140

NotEmptySet to inline class #137

LVMVRQUXL opened this issue Jul 7, 2023 · 2 comments · Fixed by #148 or #152
Assignees
Labels
common Item related to all platforms. feature New feature or request.
Milestone

Comments

@LVMVRQUXL
Copy link
Contributor

LVMVRQUXL commented Jul 7, 2023

Description

Like discussed in the issue #97, we would like to convert the NotEmptySet type to an inline class.

This is breaking change: the copy function will be unavailable after this migration.

Checklist

  • Add unit tests for the equals function.
  • Migrate the type to an inline class without breaking its API (except for the copy function).
  • Improve the type's documentation.
  • Check the generated documentation.
  • Check and update the public API binaries.
  • Update the Unreleased section in changelog.
  • Refactor the construction of NotEmptySet.
  • Update the type's documentation.
  • Update all tests of this type.
@LVMVRQUXL LVMVRQUXL added feature New feature or request. common Item related to all platforms. labels Jul 7, 2023
@LVMVRQUXL LVMVRQUXL added this to the 4.3.0 milestone Jul 7, 2023
@LVMVRQUXL
Copy link
Contributor Author

LVMVRQUXL commented Jul 15, 2023

See the issue #136 and the PR #145 for more information about how to convert this type to an inline class.

@LVMVRQUXL LVMVRQUXL added good first issue Issues having enough details for new contributors to work on. and removed good first issue Issues having enough details for new contributors to work on. labels Jul 15, 2023
@LVMVRQUXL LVMVRQUXL self-assigned this Jul 23, 2023
@LVMVRQUXL LVMVRQUXL changed the title NotEmptySet to normal or inline class NotEmptySet to inline class Jul 23, 2023
LVMVRQUXL added a commit that referenced this issue Jul 24, 2023
LVMVRQUXL added a commit that referenced this issue Jul 27, 2023
LVMVRQUXL added a commit that referenced this issue Jul 27, 2023
@LVMVRQUXL
Copy link
Contributor Author

We need to refactor the construction of the NotEmptySet for better performance.
Please note that changes made to the original collection should not be reflected to the resulting NotEmptySet.

val original: MutableSet<Int> = mutableSetOf(1, 2, 3, 1)
val notEmptySet: NotEmptySet<Int> = original.toNotEmptySet()
    .getOrThrow()
println(original) // [1, 2, 3]
println(notEmptySet) // [1, 2, 3]

original.clear()
println(original) // []
println(notEmptySet) // [1, 2, 3]

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Item related to all platforms. feature New feature or request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant