Is it currently possible to do a comprehension on ...
# arrow
o
Is it currently possible to do a comprehension on
ValidatedNel
that would accumulate
Invalid
bindings? i.e. do something like the following,
Copy code
val validated: ValidatedNel<String, List<Int>> = validated {
    val err1 = invalidNel<String, Int>("errorMsg1").bind()
    val foo = 1.valid().bind()
    val bar = 2.valid().bind()
    val err2 = invalidNel<String, Int>("errorMsg2").bind()
    listOf(foo, bar, err1, err2)
}
but this returns
Invalid(NonEmptyList([errorMsg1]))
, and does not accumulates invalid bindings (i.e. I would like it to return
Invalid(NonEmptyList([errorMsg1, errorMsg2]))
). Thanks!