= Solution
\b[`inits` is not a direct <list fold>:] `inits undefined = [] : undefined` has a defined outer constructor, while `foldr c z undefined` is $\bot$.
\b[Both `pinits` and `ninits` are direct <list folds>:]
``
pinitsFold :: [a] -> [[a]]
pinitsFold = foldr (\x yss -> [] : map (x:) yss) []
ninitsFold :: [a] -> [[a]]
ninitsFold = foldr (\x yss -> [x] : map (x:) yss) []
``
For `pinits`, the combining function is exactly the recursive step above. For `ninits`, expand `inits xs = [] : ninits xs` and use
$$
\operatorname{map}(x:)([]:yss)=[x]:\operatorname{map}(x:)yss.
$$
Neither step needs to inspect `yss` before producing its first outer constructor. Thus the definitions satisfy the <fold factorisation criterion> on partial as well as total <lazy lists>.
Back to article page