tails package:Agda

The tails function takes a stream xs and returns all the suffixes of xs, starting with the longest. The result is NonEmpty because the result always contains the empty list as the last element.
tails [1,2,3] == [1,2,3] :| [[2,3], [3], []]
tails [1] == [1] :| [[]]
tails [] == [] :| []
The tails1 function takes a NonEmpty stream xs and returns all the non-empty suffixes of xs, starting with the longest.
tails1 (1 :| [2,3]) == (1 :| [2,3]) :| [2 :| [3], 3 :| []]
tails1 (1 :| []) == (1 :| []) :| []