You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ambiguity between recursiveTRecursive and birecursiveTBirecursive, apparently in top-level package object.
How to reproduce
import matryoshka._
import matryoshka.implicits._
import matryoshka.data.Fix
implicitly[Recursive[Fix[Option]]]
<console>:19: error: ambiguous implicit values:
both method recursiveTRecursive in package matryoshka of type [T[_[_]], F[_]](implicit evidence$81: matryoshka.RecursiveT[T])matryoshka.Recursive.Aux[T[F],F]
and method birecursiveTBirecursive in package matryoshka of type [T[_[_]], F[_]](implicit evidence$83: matryoshka.BirecursiveT[T])matryoshka.Birecursive.Aux[T[F],F]
match expected type matryoshka.Recursive[matryoshka.data.Fix[Option]]
implicitly[Recursive[Fix[Option]]]
^
Thanks, @klaeufer. Currently, this isn’t much of a problem in practice, because it’s rare that you can actually resolve Recursive[T], usually you need Recursive.Aux[T, F], and (unfortunately) you can’t get there from Birecursive.
This is still a problem, though, and will be worse once we get the type class hierarchy working as intended. Prioritizing the implicits should fix it. I’ll do that soon.
I just ran into this, which reminded me of this issue, and so I’ll actually fix it now 😆 (Although I hope it’s not gotten in your way in the mean time.)
Symptoms
cata
and other recursion patterns unavailable forFix
and related types.Causes
Ambiguity between
recursiveTRecursive
andbirecursiveTBirecursive
, apparently in top-level package object.How to reproduce
Same problem for
Mu
andNu
.Workaround
The text was updated successfully, but these errors were encountered: