Skip to content
Snippets Groups Projects
Andrew Lelechenko's avatar
Bodigrim authored
`compareLength xs n` is a safer and faster alternative to `compare (length xs) n`.
The latter would force and traverse the entire spine (potentially diverging),
while the former traverses as few elements as possible.

The implementation is carefully designed to maintain as much laziness as possible.

As per https://github.com/haskell/core-libraries-committee/issues/257
39c40e6c
History
Name Last commit Last update