Add type class constraint to `palindrome`.