'brew list --cask --version' produces an unsorted list. Also, the cask part of 'brew list --version' is unsorted, while the formulas are (still) sorted.
Library
This directory contains all the code run by the official brew command in Homebrew and all formulae (package descriptions) in taps (repositories containing formulae) in Taps subdirectories.