@sig(H/ ["a"] >> t(Maybe, ("a", ["a"])))
def uncons(xs):
    """
    uncons :: [a] -> Maybe (a, [a])

    Decompose a list into its head and tail. If the list is empty, returns
    Nothing. If the list is non-empty, returns Just((x, xs)), where x is the
    head of the list and xs its tail.
    """
    return Just((head(xs), tail(xs))) if not null(xs) else Nothing
dataset/ETHPy150Open billpmurphy/hask/hask/Data/List.py/uncons/original