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

Changes / additions for consistency with Lens #33

Open
tysonzero opened this issue Apr 2, 2019 · 2 comments
Open

Changes / additions for consistency with Lens #33

tysonzero opened this issue Apr 2, 2019 · 2 comments

Comments

@tysonzero
Copy link

tysonzero commented Apr 2, 2019

In lens there is:

folded :: Foldable f => Fold (f a) a
mapped :: Functor f => Setter (f a) (f b) a b
traverse :: Traversable f => Traversal (f a) (f b) a b

So witherable should have:

filtered :: Filterable f => Filter (f a) (f b) a b
wither :: Witherable f => Wither (f a) (f b) a b

The existing Filter would have to be renamed to Wither as it actually only works for Witherable types, not just for Filterable types. A new Filter would be added with type forall f. Settable f => FilterLike f s t a b.

wither already exists and has the correct type, so just some docs to indicate as such seems fine. filtered would have to actually be added: filtered = sets mapMaybe.

@juliapath
Copy link

Or without using Settable Filter would be FilterLike Identity.

@fumieval
Copy link
Owner

I deprecated the "optics" because they are not quite composable. If there is demand, we could design proper wither optics.

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

No branches or pull requests

3 participants