def typematch(ty, impl):
    """
    See whether type instance `ty` is a type for value instances of `impl`.

        >>> @jit('Foo[a, b]')
        ... class Foo(object):
        ...     pass
        ...
        >>> typematch(Foo[int32, 2], Foo)
        True
    """
    return isinstance(ty, type(impl.type))