def METHOD_NAME(ruletypes):
    """Apply rules based on the expression type.
    Examples
    ========
    >>> rm_zeros = rm_id(lambda x: x == 0)
    >>> rm_ones = rm_id(lambda x: x == 1)
    >>> remove_idents = typed({Add: rm_zeros, Mul: rm_ones})
    """
    return switch(type, ruletypes)