@sig(H/ ["a"] >> [["a"]])
def tails(xs):
    """
    tails :: [a] -> [[a]]

    The tails function returns all final segments of the argument, longest
    first.
    """
    if null(xs):
        return L[[L[[]]]]
    return L[(xs[n:] for n,_ in enumerate(xs))] + L[[L[[]]]]


#=============================================================================#
## Predicates
dataset/ETHPy150Open billpmurphy/hask/hask/Data/List.py/tails/original