Yes, it's all good and nice that your types are sound and you don't have panics, but I feel like this could get you in trouble in the real world (gleam also uses this division convention, and people very much use gleam for "real world" things). Suppose you took an average over an unintentionally empty list (maybe your streaming data source just didn't send anything over the last minute due to a backhoe hitting a fibe…
Gleam offers division functions that return an error type, and you can use those if you need that check.
They fit a list-length use case well as they work better with a piping syntax which is popular in Gleam.
[1] https://blog.nestful.app/p/why-i-rewrote-nestful-in-gleam