Use a typeclass instead of a function

Conversion between posts