Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Generalize lpadZip/rpadZip #200

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.

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

Successfully merging this pull request may close these issues.

1 participant