I want to write a function showAll that takes a List of values and produces a String obtained by concatenating the String representations of each of the values, using the Show instances available in implicit scope.
There should be no constraint on the type of the elements of the list, other than the presence of the Show instance.
For example:
case class Person(name: String)
implicit val showPerson: Show[Person] = Show.by(_.name)
showAll(List(1, Person("Martin")))
should output:
1 Martin
In this case the function is using Show[Int] and Show[Person] instances.
What would be a proper signature for the function?
Thanks.