diff --git a/crates/compiler/builtins/roc/List.roc b/crates/compiler/builtins/roc/List.roc index 168de8181a..a729c2febb 100644 --- a/crates/compiler/builtins/roc/List.roc +++ b/crates/compiler/builtins/roc/List.roc @@ -39,6 +39,7 @@ interface List max, map4, mapTry, + walkTry, dropFirst, joinMap, any, @@ -959,9 +960,8 @@ mapTry = \list, toResult -> Result.map (toResult elem) \ok -> List.append state ok -## This is the same as `iterate` but with Result instead of [Continue, Break]. +## This is the same as `iterate` but with [Result] instead of `[Continue, Break]`. ## Using `Result` saves a conditional in `mapTry`. -## It might be useful to expose this in userspace? walkTry : List elem, state, (state, elem -> Result state err) -> Result state err walkTry = \list, init, func -> walkTryHelp list init func 0 (List.len list) diff --git a/crates/compiler/module/src/symbol.rs b/crates/compiler/module/src/symbol.rs index df6acd2b7f..3e4a130445 100644 --- a/crates/compiler/module/src/symbol.rs +++ b/crates/compiler/module/src/symbol.rs @@ -1373,6 +1373,7 @@ define_builtins! { 72 LIST_SUBLIST_LOWLEVEL: "sublistLowlevel" 73 LIST_CAPACITY: "capacity" 74 LIST_MAP_TRY: "mapTry" + 75 LIST_WALK_TRY: "walkTry" } 7 RESULT: "Result" => { 0 RESULT_RESULT: "Result" exposed_type=true // the Result.Result type alias