So I have a List<Optional<T>> and I wa...
# arrow
a
So I have a List<Optional<T>> and I want an Optional<List<T>> One way to do this is with traverse, but if one of my optionals is empty, then the whole traverse would return empty. Instead, I just want that optional ignored, and the only time the whole thing resolves to empty is if all the optionals inside List are empty… does that make sense? I can code around a solution but I thought I’d ask if there was a pre-existing transformation for this…
transform id xs
for example will return Nothing if anything in xs is Nothing