Stream: ideas

Topic: List Builtin api


view this post on Zulip Norbert Hajagos (Mar 15 2026 at 20:15):

I'm implementing List.replace. Right now this is its type signature:
replace : List(item), U64, item -> Try({ list : List(item), value : item }, [OutOfBounds, ..])
I think the value field of the returned record isn't clear what it is, until you read the docs or think about the possibilities of what it could it be, after which you narrow it down to 1 thing. The previous value that was replaced. The Rust based compiler used value. I'd suggest naming it prev_value, old or old_value. What do you think, what should be the field name?

view this post on Zulip Luke Boswell (Mar 15 2026 at 20:16):

prev maybe?

view this post on Zulip Norbert Hajagos (Mar 15 2026 at 20:29):

That's good also


Last updated: Jun 16 2026 at 16:19 UTC