Stream: ideas

Topic: missing `List.map_try!`


view this post on Zulip Anton (Apr 28 2025 at 09:43):

I just noticed that we don't have the effectful version of List.map_try, can I add it? It seems pretty essential.

view this post on Zulip Richard Feldman (Apr 28 2025 at 11:05):

we talked about it and I'd like to hold off

view this post on Zulip Richard Feldman (Apr 28 2025 at 11:07):

I think it's possible that it's a good idea, but also possible that it's not really something that should be done in practice in comparison to, say, a for loop

view this post on Zulip Richard Feldman (Apr 28 2025 at 11:10):

if there's actually demand for it in practice, should be easy to add!

view this post on Zulip Anton (Apr 28 2025 at 11:16):

Richard Feldman said:

if there's actually demand for it in practice

Yeah, I wanted to use it for a script I was writing, I can use walk_try! but it's a lot more cumbersome.

view this post on Zulip Anton (Apr 28 2025 at 11:18):

also possible that it's not really something that should be done in practice in comparison to, say, a for loop

I wanted to execute an effectful function for a list of files, map would be the cleanest way to do it

view this post on Zulip Richard Feldman (Apr 28 2025 at 11:22):

ok fair enough!

view this post on Zulip Richard Feldman (Apr 28 2025 at 11:23):

that makes sense, let's add it :+1:

view this post on Zulip Richard Feldman (Apr 28 2025 at 11:23):

I actually remember doing that exact thing in Clojure many years ago, now that you mention it

view this post on Zulip Isaac Van Doren (Apr 28 2025 at 21:05):

I was just playing around with rewriting a CI script at work in Roc and wound up wanting this also, so I’m glad to have it!

view this post on Zulip Anton (Apr 29 2025 at 15:21):

PR for map_try! is ready https://github.com/roc-lang/roc/pull/7770

view this post on Zulip Anton (Apr 30 2025 at 11:40):

map_try! is available in the nightly


Last updated: Jun 16 2026 at 16:19 UTC