Skip to content

Commit

Permalink
mapOrAccumulate
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Apr 27, 2024
1 parent ca9058a commit 63101f2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import arrow.core.NonEmptyList
import arrow.core.raise.Raise
import arrow.core.raise.either
import arrow.core.raise.forEachAccumulating
import arrow.core.raise.mapOrAccumulate

@JvmInline
value class Age private constructor(val value: Int) {
Expand Down Expand Up @@ -34,4 +35,7 @@ fun main() {

println(either1)
println(either2)

val either3: Either<NonEmptyList<InvalidAge>, List<Age>> = either { mapOrAccumulate(ints) { Age.from(it) } }
println(either3)
}

0 comments on commit 63101f2

Please sign in to comment.