What is the intention of the program below?
```
def p1(arr):
    i = 0
    while i < len(arr):
        x = arr[i]
        if not isinstance(x, list):
            yield x
        else:
            for y in p1(x):
                yield y
        i += 1
```