The
inits function takes a stream
xs and returns all
the finite prefixes of
xs, starting with the shortest. The
result is
NonEmpty because the result always contains the empty
list as the first element.
inits [1,2,3] == [] :| [[1], [1,2], [1,2,3]]
inits [1] == [] :| [[1]]
inits [] == [] :| []