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

Fix TypedTabledEntity build #94

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Fix TypedTabledEntity build #94

merged 1 commit into from
Oct 16, 2024

Conversation

oguzhanunlu
Copy link
Collaborator

@oguzhanunlu oguzhanunlu commented Oct 16, 2024

This PR fixes a bug introduced after 0.8.0-M2. See the snippet below for a simpler visualization.

scala> import cats.data.NonEmptyList
import cats.data.NonEmptyList

scala> import cats.syntax.all._
import cats.syntax.all._

scala> def parseInt(s: String): Option[Int] = Either.catchOnly[NumberFormatException](s.toInt).toOption
def parseInt(s: String): Option[Int]

scala> NonEmptyList.of("1", "2", "3").traverse(parseInt)
val res0: Option[cats.data.NonEmptyList[Int]] = Some(NonEmptyList(1, 2, 3))

scala> NonEmptyList.of("1", "two", "3").traverse(parseInt)
val res1: Option[cats.data.NonEmptyList[Int]] = None

scala> NonEmptyList.of("1", "two", "3").toList.flatMap(parseInt).toNel
val res2: Option[cats.data.NonEmptyList[Int]] = Some(NonEmptyList(1, 3))

Copy link
Contributor

@istreeter istreeter left a comment

Choose a reason for hiding this comment

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

Many thanks for this fix @oguzhanunlu

@oguzhanunlu
Copy link
Collaborator Author

I had to rebase on top of updated develop and force push, proceeding with merge

@oguzhanunlu oguzhanunlu merged commit 8fe2d8c into develop Oct 16, 2024
1 check passed
@oguzhanunlu oguzhanunlu deleted the fix-tte branch October 16, 2024 09:07
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