Show type class instance for Predicate
Remove Predicate.show and use Show type class instead
Agreed. The string representation of a predicate should not be the concern of the Predicate type class.
I'd like to add that we can't use something like cats.Show here because it has only one type parameter (Show[T] { def show(t: T): String }) but what we need is a typeclass that can show a value of type T for some predicate P. So we need at least a Show[T, P] { def show(t: T): String }.
Is not it T Refined P? Or another class F[T, P] ?
Currently the F is not needed to show a T in the context of a predicate P. Would the string representation differ for different Fs? For me, the F (which has a RefType instance) is just the carrier for the refinement, it is something that ties the T and P together with the additional meaning that the contained T is valid according to P. We also want to use show for values that are invalid and if we use Show[F[T, P]] we'd have to construct invalid F[T, P] values before we can show them.
Just a remark: Show would also be beneficial for aliases like type GreaterEqual[N] = Not[Less[N]]. The Validate instance for GreaterEqual[N] gets currently assembled from a Validate for Not and Less with an acceptable validate function and with a show function that produces strings like "!(1 < 0)" (which are technically correct but not very readable). It would be nice to provide a Show[GreaterEqual[N]] explicitly which produces strings like "(1 >= 0)".