Skip to content

Comments

PoC: Add non-empty folds#483

Open
phadej wants to merge 1 commit intomasterfrom
ne-fold
Open

PoC: Add non-empty folds#483
phadej wants to merge 1 commit intomasterfrom
ne-fold

Conversation

@phadej
Copy link
Contributor

@phadej phadej commented Mar 12, 2023

As Foldable1 is in base-4.18 and there is a light compatibility package, we can do this somewhat easily.

This breaks symmetry of hierarchy,as there is no NeTraversal, but it's much less useful than non-empty folds (i.e. to semigroups).

This (softly) needs a Foldable1WithIndex to be added to indexed-traversable, which I'll do some time in the future (after GHC-9.6 updates are somewhat settled).

Partly implements #34

@phadej
Copy link
Contributor Author

phadej commented May 2, 2023

Updated with a proof-of-concept of indexed folds too.

I'll leave this at this state until someone else asks for non-empty folds, but I'm probably going to release indexed-traversable-0.1.3 in near future.

As Foldable1 is in base-4.18 and there is a light
compatibility package, we can do this somewhat easily

This breaks symmetry of hierarchy,as there is no NeTraversal,
but it's much less useful than non-empty folds (i.e. to semigroups)
@phadej
Copy link
Contributor Author

phadej commented Dec 3, 2023

indexed-traversable-0.1.3 has been released (some time ago already)

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