Create an invariant requiring the value is an instance of ``cls``.

def instance_of(cls):
    """
    Create an invariant requiring the value is an instance of ``cls``.
    """
    def check(value):
        return (
            isinstance(value, cls),
            u"{value!r} is instance of {actual!s}, required {required!s}".format(
                value=value,
                actual=fullyQualifiedName(type(value)),
                required=fullyQualifiedName(cls),
            ),
        )
    return check