-
Notifications
You must be signed in to change notification settings - Fork 274
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
Separate Each into own package #1050
Comments
A cursorary search https://hackage-search.serokell.io/?q=%5Einstance.*Each+ suggests that this change will mostly break my packages, if |
Just to clarify, what is the type that you propose for the class Each s t a b | s -> a, t -> b, s b -> t, t a -> s where
each :: Traversal s t a b But I was under the impression that |
class Each s t a b | s -> a, t -> b, s b -> t, t a -> s where
each :: Traversal s t a b
-- default each = traverse
class Each s t a b => EachWithIndex i s t a b | s -> i a, t -> i b, s b -> t, t a -> s where
ieach :: Applicative f => (i -> a -> f b) -> s -> f t
-- default ieach = itraverse
Note: recall that itraversed :: TraversableWithIndex i t => IndexedTraversal i (t a) (t b) a b
itraversed = conjoined traverse (itraverse . indexed) that's so Would this cause issues? The name clash will, as One of my motivations is to use |
This is similar change to previous
indexed-traversable
,strict
,assoc
extractions.Each
is useful on the own, after all it's just aTraversal
i.e. definable (and usable!) with just abase
.optics
defines slightly differentEach
which is more likeEachWithIndex
, which is reasonable thing to have too. So maybeoptics
could use the same package / instances.I'll draft the package soon.
The text was updated successfully, but these errors were encountered: