How does Array.Extra.all short circuit?

With Arrays I iterated over a slice using Array.get:

This was used to implement a GapBuffer for a text editor. I certainly found that doing it this way was efficient enough to get a UI that scrolled smoothly. But yes, the Array.get access is O(Log n), so not as fast as it could be:

Demo: https://kind-colden-ebafc2.netlify.app/

1 Like