Last active
December 13, 2020 16:10
-
-
Save DmytroMitin/ed22c9a84d5c89a46148a073b92052da to your computer and use it in GitHub Desktop.
Implicit object works and implicit val doesn't https://stackoverflow.com/questions/55548968/how-to-use-functors-with-scala-cats/55549231#comment97803502_55549231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shapeless.{::, HNil, Poly1, poly} | |
object App { | |
implicit object p extends Poly1 { | |
implicit val cse: Case.Aux[Int, String] = at(_.toString) | |
} | |
// implicit val p = new Poly1 { | |
// implicit val cse: Case.Aux[Int, String] = at(_.toString) | |
// } | |
def foo[A <: Poly1](implicit pp: A, c: poly.Case[A, Int :: HNil]) = ??? | |
foo | |
} |
Author
DmytroMitin
commented
Apr 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment