@sig(H/ (H/ "a" >> bool)  >> ["a"] >> (["a"], ["a"]))
def span(p, xs):
    """
    span :: (a -> Bool) -> [a] -> ([a], [a])

    span, applied to a predicate p and a list xs, returns a tuple where first
    element is longest prefix (possibly empty) of xs of elements that satisfy p
    and second element is the remainder of the list
    """
    front = takeWhile(p, xs)
    rest = xs[len(front):]
    return front, rest
dataset/ETHPy150Open billpmurphy/hask/hask/Data/List.py/span/original