Skip to content

Generalize lpadZip/rpadZip #200

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Generalize lpadZip/rpadZip #200

wants to merge 1 commit into from

Conversation

mniip
Copy link

@mniip mniip commented Jun 25, 2024

This generalizes the left/right padding functions from lists to anything that is Zip. A particularly useful use-case is NonEmpty.

This also makes them lazier with respect to infinite lists: lpadZip (repeat ()) [] no longer hangs as it tries to catMaybes infinitely many Nothings.

The shape preservation aspect follows from the absorption laws of Zip.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant