question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

neotypes.Async implicit imports cause divergent implicits

See original GitHub issue

I have code that uses cats-effect with higher-kinded types in most of my functions. Here’s an example that should compile fine using the cats.effect.Async typeclass:

import cats.implicits._
import cats.effect._

def flatMapF[F[_]: Async](f: F[Any]): F[Unit] = f.flatMap(_ => Async[F].unit)

This code compiles and works fine unless I import the implicits for neotypes.Async by importing neotypes.implicits.all._ or neotypes.implicits.syntax.all._. The code fails to compile due to a divergent implicit leading the compiler to not know which flatMap method to call.

Currently using the latest snapshot build from master, built locally (0.9.1-SNAPSHOT).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
gvolpecommented, Jun 28, 2019

Is there any place in user land where map and flatMap might be used for neotypes.Async[F]? If not I think it should be better to hide this from the public API.

1reaction
dimafengcommented, Jun 28, 2019

@sloshy @BalmungSan wow that’s amazing exploration and brainstorm!

@BalmungSan I support the approach with making it private. I’m going to complete and merge #34 tomorrow

Read more comments on GitHub >

github_iconTop Results From Across the Web

neotypes: Overview
Scala lightweight, type-safe, asynchronous driver for neo4j. ... derive an implicit ResultMapper for case classes. import neotypes.implicits.syntax.string.
Read more >
How can I solve the Diverging implicit expansion for type
But I need to be able to compare Events of different values V . How can I solve this diverging implicit expansion? import...
Read more >
What do all the newbie's feel about the diverging implicits ...
Yes, that import brings more implicits into scope. This makes implicit resolution diverge. If you only have the Sync instance/implicit for IO in ......
Read more >
Awesome JavaScript Awesome - DirDev.com
Awesome JavaScript Awesome. A collection of awesome browser-side JavaScript libraries, resources and shiny things. Awesome JavaScript; Package Managers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found