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

Adjust implicit priorities in OneAnd. #538

Merged
merged 1 commit into from
Sep 23, 2015
Merged

Adjust implicit priorities in OneAnd. #538

merged 1 commit into from
Sep 23, 2015

Commits on Sep 22, 2015

  1. Adjust implicit priorities in OneAnd.

    scala> implicitly[Functor[NonEmptyList]]
    <console>:27: error: ambiguous implicit values:
     both method oneAndFunctor in trait OneAndInstances ...
     and method oneAndMonad in trait OneAndInstances ...
     match expected type cats.Functor[cats.data.NonEmptyList]
    
    There were two bugs: one is that the Monad implicit
    conflicts with the Functor implicit. The other is that
    this construction doesn't work:
    
      object OneAnd extends OneAndInstances with OneAndLowPriority
    
    If it DID work, this ordering would give priority to the
    implicits found in OneAndLowPriority, so it's reversed - but
    more to the point, implicit priority isn't based on linearization.
    One of the traits has to be a subtrait of the other to have
    higher priority, and as written they had no relationship.
    paulp committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    b11f414 View commit details
    Browse the repository at this point in the history