def split_arrow(type):
    type = type.get_repr()
    lhs = []
    while isinstance(type, TypeArrow):
        lhs.append(type.left)
        type = type.right
    return (lhs, type)
def split_arrow(type):
    type = type.get_repr()
    lhs = []
    while isinstance(type, TypeArrow):
        lhs.append(type.left)
        type = type.right
    return (lhs, type)