def type_match(a, b):
    """Return True of the types of a and b are compatible, False otherwise."""
    # If the types are the same, return True
    if a['type'] == b['type']:
        return True
    # Otherwise, look at some special cases
    eq_groups = [
        {'ONT::GENE-PROTEIN', 'ONT::GENE', 'ONT::PROTEIN'},
        {'ONT::PHARMACOLOGIC-SUBSTANCE', 'ONT::CHEMICAL'}
        ]
    for eq_group in eq_groups:
        if a['type'] in eq_group and b['type'] in eq_group:
            return True
    return False