After reading the FAQ, specifically the section about why there is no Maybe in the stdlib, I rewrote this solution (from advent of code) to a version without a Maybe. Is this the canonical way of combining multiple results? Or should I write a map2? And why isn't there a map2 in the stdlib?
Btw: I'm having a great time with roc so far! I'm very curious how roc will perform and feel on a large production code base in the future!
Yeah, there is no map2 in the stdlib currently. You could also do something like
Result.try result1 \ok1 -> Result.try result2 \ok2 -> Ok {ok1, ok2}
which is functionally equivalent to map2
Thank you!
Last updated: Jul 06 2025 at 12:14 UTC