Not Sure How to Write the Implicit for Equality Using Scalaz

57 Views Asked by At

In Cats I can do

  import cats.Eq
  implicit val eq: Eq[Foo] = Eq.fromUniversalEquals[Foo]

How do I do this using Scalaz (7.3.1)? I tried this from the examples in the repo but I got a compile error:

  import scalaz._
  import Scalaz._
  implicit val eq: Equal[Foo] = Decidable[Equal].xderiving0(Foo)
1

There are 1 best solutions below

0
AudioBubble On BEST ANSWER

The equivalent universal equality representation in Scalaz would be:

    implicit val eq: Equal[Foo] = Equal.equalA[Foo]