@sig(H[(Ord, "a")]/ "a" >> ["a"] >> ["a"])
def insert(x, xs):
    """
    insert :: Ord a => a -> [a] -> [a]

    The insert function takes an element and a list and inserts the element
    into the list at the first position where it is less than or equal to the
    next element. In particular, if the list is sorted before the call, the
    result will also be sorted.
    """
    def __insert(x, xs):
        for i in xs:
            if x > i:
                yield x
            yield i
    return L[__insert(x, xs)]


#=============================================================================#
# Generalized functions
## The "By" operations
### User-supplied equality (replacing an Eq context)
dataset/ETHPy150Open billpmurphy/hask/hask/Data/List.py/insert/swapped operands of `>`