@sig(H[(Eq, "a")]/ "a" >> ["a"] >> [int])
def elemIndices(x, xs):
    """
    elemIndices :: Eq a => a -> [a] -> [Int]

    The elemIndices function extends elemIndex, by returning the indices of all
    elements equal to the query element, in ascending order.
    """
    return L[(i for i, a in enumerate(xs) if a == x)]
dataset/ETHPy150Open billpmurphy/hask/hask/Data/List.py/elemIndices/original