with this code:
let a = [3; 4; 5; 6; 7]
let check x = if x % 2 = 0 then Ok x else Error x
let b = a |> List.map check
how can I summarize B as:
- if all Ok, then Ok<int list>
- if any Error, then Error<int list>
I could make a method that does this, but I can't help thinking that this has to be built in, or there has to be a clever simple way to make it happen (I have FsToolkit.ErrorHandling btw, in case it's built in there.