here I’d prefer a normal while loop: there is no state that is protected by this pattern here (i.e. normally we use it to turn `var` into `val`)