-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lists: enable zip functions to work on lists of different lengths
This change enables the functions zip, zip3, zipwith and zipwith3 of the lists module to accept an optional extra parameter which specifies the behavior in case the given lists are of different lengths: * fail: The call will fail with an error exception. This is the default, and the same as the current behavior. * trim: The longer list(s) will be trimmed to the length of the shortest list, such that surplus elements in the longer list(s) will be ignored. * {pad, Defaults}: The shorter list(s) will be padded to the length of the longest list using the respective element(s) from the given Defaults tuple. Co-authored-by: Björn Gustavsson <bgustavsson@gmail.com> Co-authored-by: Jan Uhlig <juhlig@hnc-agency.org>
- Loading branch information
1 parent
6664a6f
commit 93748a8
Showing
5 changed files
with
603 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.