Closed fendor closed 3 years ago
Thanks for the catch. It was deliberate, see 6d052846c07489caaf449ffa0eca864694c96bf8. The reasoning was for consistency with Haskell zip
, so that's probably what people expect.
But I forgot to update the docs, despite adding a test case showing it truncating stuff. I've done so now, most appreciated!
source: https://github.com/ndmitchell/extra/blob/f1f20850580eb6a26955e279d6b3bf70af71c716/src/Data/List/Extra.hs#L240
The fix depends on the actual intention, but since this is a released function, I suggest to change this to something like
Truncates the output if the enumeration runs out
Happy to provide a PR if that is the intent of the function.