looking to do a transformation of arrow types, but...
# arrow
t
looking to do a transformation of arrow types, but having trouble coming up with a succinct call chain. i have a
List<() -> Validated<E, A>>
which i want to transform into
ValidatedNel<E, A>
by: 1. specifying invalid value if the list is empty 2. calling items until the first valid value is encountered 3. aggregating invalid values until (2) 4. ignoring items after (2) i can come up with an "ugly" way to do this easily enough, but i'm curious if there's a nice fluent pattern for it. thanks in advance!
s
Hmm, I don't believe there is anything that satisfies
2
.
traverse
will continue running after encountering the first valid value.
t
thanks @simon.vergauwen, that was my experience as well.
separateValidated()
with a
Sequence
is my closest approximation that allows avoiding traversal past the first valid value.