• Ryan Scott's avatar
    Use lengthIs and friends in more places · a786b136
    Ryan Scott authored and Ben Gamari's avatar Ben Gamari committed
    While investigating #12545, I discovered several places in the code
    that performed length-checks like so:
    length ts == 4
    This is not ideal, since the length of `ts` could be much longer than 4,
    and we'd be doing way more work than necessary! There are already a slew
    of helper functions in `Util` such as `lengthIs` that are designed to do
    this efficiently, so I found every place where they ought to be used and
    did just that. I also defined a couple more utility functions for list
    length that were common patterns (e.g., `ltLength`).
    Test Plan: ./validate
    Reviewers: austin, hvr, goldfire, bgamari, simonmar
    Reviewed By: bgamari, simonmar
    Subscribers: goldfire, rwbarton, thomie
    Differential Revision: https://phabricator.haskell.org/D3622