Hello, this pattern is showing up frequently and I'm wondering if this is a more idiomatic way to write this:
let list_result = foo() // returns Result(List(String), SomeError)
case list_result {
Ok(my_list) -> list.map(my_list, string.length)
_ -> []
}
Basically, error case should be unwrapped to [] and good case needs to be mapped to some other list. Is there a way to achieve this in fewer lines of code.