O(n), where
n is the length of the result. The unfoldr
function is analogous to the List
unfoldr. unfoldr builds a
stream from a seed value. The function takes the element and returns
Nothing if it is done producing the stream or returns Just (a,b), in
which case, a is the next Char in the string, and b is the seed value
for further production.
Properties
unstream . unfoldr f z = unfoldr f z