I have a method that can save any type if this type has an instance io.circe.Encoder[A], something like this:
def persist[A](a: A)(implicit ea: Encoder[A]): Boolean
Now, by testing this, I can create any old case class or set of case classes on a sealed basis, create ADT and use typeclass automatic output to create Encoder, as well as create ScalaCheck Arbitrary, which makes this very enjoyable for testing.
Is it possible to use Shapeless in some way to create arbitrary families of case classes (and therefore automatically output instances of Encoderand Arbitrary) so that I can be sure that my method persistworks with any type?
I do not know where to start from this, not to mention trying to describe the type for this.
source
share