Created
April 27, 2013 08:27
-
-
Save pelotom/5472335 to your computer and use it in GitHub Desktop.
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
// Here's the problem I was having: | |
scala> val unapply = implicitly[Unapply[Applicative, List[Int]]] | |
unapply: scalaz.Unapply[scalaz.Applicative,List[Int]] = scalaz.Unapply$$anon$14@5a977cac | |
scala> implicitly[Unapply[Applicative, unapply.M[unapply.A]]] | |
<console>:15: error: Unable to unapply type `unapply.M[unapply.A]` into a type constructor of kind `M[_]` that is classified by the type class `scalaz.Applicative` | |
1) Check that the type class is defined by compiling `implicitly[scalaz.Applicative[<type constructor>]]`. | |
2) Review the implicits in object Unapply, which only cover common type 'shapes' | |
(implicit not found: scalaz.Unapply[scalaz.Applicative, unapply.M[unapply.A]]) | |
implicitly[Unapply[Applicative, unapply.M[unapply.A]]] | |
^ | |
// Here's how I solved it: | |
scala> implicit val evidence: Applicative[unapply.M] = unapply.TC | |
evidence: scalaz.Applicative[unapply.M] = scalaz.std.ListInstances$$anon$1@23dc9fb9 | |
scala> implicitly[Unapply[Applicative, unapply.M[unapply.A]]] | |
res1: scalaz.Unapply[scalaz.Applicative,unapply.M[unapply.A]] = scalaz.Unapply$$anon$14@d6e32d7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment