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

Give some love to the Validation code #1426

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Give some love to the Validation code #1426

merged 1 commit into from
Nov 26, 2024

Conversation

guizmaii
Copy link
Member

  • Create only 1 instance of fail(())
  • Use NonEmptyChunk.single in ZValidation.fail

@guizmaii guizmaii requested a review from a team as a code owner November 26, 2024 05:33
@guizmaii guizmaii self-assigned this Nov 26, 2024
@guizmaii guizmaii requested review from kyri-petrou and a team and removed request for a team November 26, 2024 05:33
- Create only 1 instance of `fail(())`
- Use `NonEmptyChunk.single` in `ZValidation.fail`
Copy link
Member

@sideeffffect sideeffffect left a comment

Choose a reason for hiding this comment

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

Nice, thank you!

@@ -374,6 +374,7 @@ sealed trait ZValidation[+W, +E, +A] { self =>
}

object ZValidation extends LowPriorityValidationImplicits {
private val unitFailure: Validation[Unit, Nothing] = fail(())
Copy link
Member

Choose a reason for hiding this comment

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

probably doesn't make sense to make it lazy, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't indeed. It's had some synchronisation overhead

@guizmaii guizmaii merged commit a11600c into series/2.x Nov 26, 2024
21 checks passed
@guizmaii guizmaii deleted the love_validation branch November 26, 2024 23:26
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