Given a 2-tuple of Result values, if both values are Ok, return an Ok
result containing the 2-tuple of values; otherwise, return an Err value.
result2Tuple "ERROR" (Ok 1, Ok 2) --> Ok (1,2)
result2Tuple "ERROR" (Ok 1, Err "..") --> Err "ERROR"Given a 3-tuple of Result values, if all three values are Ok, return an
Ok result containing the 3-tuple of values; otherwise, return an Err
value.
Given a 4-tuple of Result values, if all three values are Ok, return an
Ok result containing the 4-tuple of values; otherwise, return an Err
value.
Given a list of Result values, if all values are Ok, return an Ok
result containing the list of values; otherwise, return an error message. When
passed an empty list, returns Ok [].
Toolkit.Result.zipList "ERROR" [Ok 1, Ok 2] --> Ok [1,2]
Toolkit.Result.zipList "ERROR" [Ok 1, Err ".."] --> Err "ERROR"
Toolkit.Result.zipList "ERROR" [] --> Ok []Given a list of Result values, return a list containing only the success
values.
Toolkit.Result.filter [ Ok 1, Ok 2, Err ".." ] --> [1, 2]
Apply a function that returns a
Resultvalue, with the initial value as the default (equivalent tof x |> Result.withDefault x). Note that the type returned in anOkresult must match the type of the initial value.