@sig((H/ "b" >> t(Maybe, ("a", "b")))/ H >> "b" >> ["a"])
def unfoldr(f, x):
    """
    unfoldr :: (b -> Maybe (a, b)) -> b -> [a]

    The unfoldr function is a `dual' to foldr: while foldr reduces a list to a
    summary value, unfoldr builds a list from a seed value. The function takes
    the element and returns Nothing if it is done producing the list or returns
    Just (a,b), in which case, a is prepended to the list and b is used as the
    next element in a recursive call
    """
    y = f(x)
    if y == Nothing:
        return L[[]]
    return y[0][0] ^ unfoldr(f, y[0][1])


#=============================================================================#
# Sublists
## Extracting sublists
dataset/ETHPy150Open billpmurphy/hask/hask/Data/List.py/unfoldr/swapped operands of `/`