-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add foldMapK and reduceMapK #2275
Comments
def foldMapK[G[_], A, B](fga: F[G[A]])(f: A => B)(implicit G: MonoidK[G]): G[B] (and similarly for |
hmm, I think I wouldn't be able to implement that without an |
def foldMapK[G[_], A, B](fga: F[A])(f: A => G[B])(implicit G: MonoidK[G]): G[B] =
foldMap(fa)(f)(G.algebra) sounds more like it, WDYT? |
Yes |
Cool, I'll work on it then |
I'm wondering how we can test this. Should there be a new law that says Alternatively, we could have tests for some concrete instance that the equivalence holds, or have a law that reuses what's in the implementation (although I doubt that's the right way to go). WDYT? |
I think a better law would be |
Could be 😅 that's actually what I meant by having a law that reused the implementation we're going to have - but I guess it would suffice for testing people's implementations if they decide to override |
I'm working on the laws, apparently adding a new type parameter ( |
You could use |
You're telling me now 😂 I already did it for |
No description provided.
The text was updated successfully, but these errors were encountered: