[distance] Use transform_variant

Remove dependency to is_implemented. Update transform_variant to support
MPL sequence input.