Scala 3, Programming Scala.
Label is typed with None.type, is because if and when we call break, it is because we are returning None to the boundary. We don’t break if we successfully computed something to return in a Some , which will be returned normally. Inspired by a similar-looking construct in Rust, if you have an