buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.15k stars 31 forks source link

Express error of callbacks in functional helpers #291

Open giann opened 1 month ago

giann commented 1 month ago

Right now user is forced to handle error in callback because we can't forward the error to the helper. We would need something like:

list.reduce::<int, SomeError>(
    fun (int i, int val, int acc) > int !> SomeError {
        | ...
    }
);