tail package:base

Warning: This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or uncons instead. Consider refactoring to use Data.List.NonEmpty.
Extract the possibly-empty tail of the stream.
The tails function returns all final segments of the argument, longest first.

Laziness

Note that tails has the following strictness property: tails _|_ = _|_ : _|_
>>> tails undefined
[*** Exception: Prelude.undefined
>>> drop 1 (tails [undefined, 1, 2])
[[1, 2], [2], []]

Examples

>>> tails "abc"
["abc","bc","c",""]
>>> tails [1, 2, 3]
[[1,2,3],[2,3],[3],[]]
>>> tails []
[[]]
The tails1 function returns all non-empty final segments of the argument, longest first.

Laziness

Note that tails1 has the following strictness property: tails1 _|_ = _|_
>>> tails1 undefined
*** Exception: Prelude.undefined
>>> drop 1 (tails1 [undefined, 1, 2])
[1 :| [2],2 :| []]

Examples

>>> tails1 "abc"
['a' :| "bc",'b' :| "c",'c' :| ""]
>>> tails1 [1, 2, 3]
[1 :| [2,3],2 :| [3],3 :| []]
>>> tails1 []
[]
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 :| []) :| []
Statistics about a single GC. This is a mirror of the C struct GCDetails in RtsAPI.h, with the field prefixed with gc_ to avoid collisions with RTSStats.
Number of bytes allocated since the previous GC
The amount of memory lost due to block fragmentation in bytes. Block fragmentation is the difference between the amount of blocks retained by the RTS and the blocks that are in use. This occurs when megablocks are only sparsely used, eg, when data that cannot be moved retains a megablock.
Total amount of live data in compact regions
Total amount of data copied during this GC
The CPU time used during GC itself
The time elapsed during GC itself
The generation number of this GC
Total amount of live data in large objects
Total amount of live data in the heap (includes large + compact data). Updated after every GC. Data in uncollected generations (in minor GCs) are considered live.
Total amount of memory in use by the RTS
The CPU time used during the post-mark pause phase of the concurrent nonmoving GC.
The time elapsed during the post-mark pause phase of the concurrent nonmoving GC.
In parallel GC, the amount of balanced data copied by all threads
In parallel GC, the max amount of data copied by any one thread. Deprecated.
Total amount of slop (wasted memory)
The time elapsed during synchronisation before GC
Number of threads used in this GC