i actually did give examples, but ok:
with while-let:
while let Some(data) = dataReader.read() {
// ...
}
vs
let done = ref(false) // also is a useless alloc unless rescript is optimizing that away, unsure
while !done.contents {
switch dataReader.read() {
| Some(data) => // ...
| None => done := true
}
}
it’s ridiculously convoluted just because we have neither while-let, if-let, break or return.
EDIT: also keep in mind that the above is just one trivial example, you’re going to have nested instances of the above in all sorts of different forms in any real-life code base with a few tens of thousands of lines in it.