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

Move FunctorEmpty and TraverseEmpty back into cats-core? #2348

Closed
LukaJCB opened this issue Jul 30, 2018 · 2 comments · Fixed by #2405
Closed

Move FunctorEmpty and TraverseEmpty back into cats-core? #2348

LukaJCB opened this issue Jul 30, 2018 · 2 comments · Fixed by #2405

Comments

@LukaJCB
Copy link
Member

LukaJCB commented Jul 30, 2018

FunctorEmpty and TraverseEmpty (used to be FunctorFilter and TraverseFilter were moved to cats-mtl when that was extracted from cats-core, as it was one of multiple leaves for Functor.
However, when I look at these two type classes, they seem to be awfully unfit for cats-mtl, as they don't have anything at all to do with monad transformers and can't even be lifted through monad stacks. I suspect the only reason they were moved at all was to use the new composition-based type class encoding (which I agree is a good reason).

I propose moving them back along with their instances as they are really useful and we shouldn't have any trouble using the composition-based type class encoding (we already use it for things like Parallel). Interested in hearing thoughts :)

@ceedubs
Copy link
Contributor

ceedubs commented Aug 14, 2018

I'm a bit partial to these type classes being in core, but I'm also the person who originally added them, so I'm a bit biased.

Note that this is also somewhat relevant to #1755.

I think that there are others who are more qualified than I am to weigh-in on the composition-based type class encoding component.

@kailuowang
Copy link
Contributor

I suspect the only reason they were moved at all was to use the new composition-based type class encoding

As far as I recall that was the main drive, although there might've been some technical reasons as well. I believe @edmundnoble also mentioned some kinkiness in writing laws for them. But I don't recall the detail and from the law code in cats-mtl, I didn't immediately see any technical issues (if to move them to core.) I'd say worth a try.

I missed having these classes in core a couple of times. so I'm also slightly +1 on moving them back too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants