Solution (source code)

= Solution

Repeated <constant time> insertion constructs the representation:
``
fromList :: [a] -> List a
fromList = foldr cons nil
``
The <right fold> preserves order because `cons` prepends its argument. On a finite length-$n$ <list>, there are $n$ calls of `cons`; completely constructing the result takes \b[$\Theta(n)$ time] and $O(n)$ constructors. This claim concerns finite inputs, not productivity of conversion from an infinite <lazy list>.