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

Remove local type classes instances and explicit type class arguments #1628

Open
jbgi opened this issue Jan 24, 2018 · 3 comments
Open

Remove local type classes instances and explicit type class arguments #1628

jbgi opened this issue Jan 24, 2018 · 3 comments

Comments

@jbgi
Copy link
Member

@jbgi jbgi commented Jan 24, 2018

If a local type class instance is lawful and coherent then it need to be a global implicit. Otherwise it should not exist and alternative implementation must be used.

Explicit type class arguments are sometimes used to work around bad type inference. In this cases it is preferable to explicit the necessary type arguments so that the right type class instance is resolved implicitly.

@emilypi
Copy link
Contributor

@emilypi emilypi commented Apr 9, 2018

@jbgi did you have any explicitly in mind as an example?

Loading

@jbgi
Copy link
Member Author

@jbgi jbgi commented Apr 10, 2018

@emilypi The ones that triggered this issue are the locally defined Monoid and Reducer at

implicit val MM: Monoid[Throwable \/ M] = Monoid.liftMonoid[Throwable \/ ?, M]
implicit val RR: Reducer[Throwable \/ A, Throwable \/ M] =

Loading

@TomasMikula
Copy link
Member

@TomasMikula TomasMikula commented Feb 10, 2019

Task has been removed in #2037. We either need a different example of local type class instance in our code base, or close this issue.

Loading

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

Successfully merging a pull request may close this issue.

None yet
3 participants