isType<T> function
Returns a Validator that checks if the given value is the correct type
Implementation
Validator isType<T>() {
return (value) => Result(
isValid: value is T,
expected: T.toString(),
value: value,
);
}