i had another question, how can i convert a List&...
# arrow
p
i had another question, how can i convert a List<ValidatedNel<Error, Result>> into
ValidatedNel<Error, List<Result>>
— basically i’d like to aggregate all errors whenever it failed
as opposed to failing first
s
For this you should use the sequence operation. For 0.11.0 this should be a top-level function called traverse and you should pass NonEmpyList.semigroup as an argument
s
Yes, but that’s for 0.12.x and onwards
For 0.11.0 it’s called sequence and it should be available as top level function on List
p
i’m thinking i should just upgrade 🙂 looks like it doesn’t actually have a kt 1.5 dependency
s
No, 0.12.0 is still on 1.4
0.12.1**
So is 0.13.0 btw
Or 0.13.2
It has the same api as Arrow 1.0.0 but is on Kotlin 1.4
Ideally you could upgrade to that version
p
ok awesome. i’ll get to 0.13.2 and try this tomorrow. ty so much for the help
👍 1
s
Happy to help any time @Pratik Tandel!
🙏 1
p
Upgrading right now and have to say the change from
either.left.a
|
either.left.b
->
either.{left,right}.value
makes sense but is kind of annoying to refactor 🙂
s
If you go through 0.12.x there should be a refactor trough IntelliJ option through deprecation of the b value
Sorry, I forgot to mention it before
p
no worries i got it fixed. we’re in a large monorepo so it’s challenging to do that via intellij
👍 1
s
p
Validated.applicativeNel seems to be gone?
s
Can be replaced by zip