Skip to content

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