inits package:rio

O(n) Return all initial segments of the given ByteString, shortest first.
The inits function returns all initial segments of the argument, shortest first. For example,
>>> inits "abc"
["","a","ab","abc"]
Note that inits has the following strictness property: inits (xs ++ _|_) = inits xs ++ _|_ In particular, inits _|_ = [] : _|_
The inits function takes a stream xs and returns all the finite prefixes of xs.
Returns a sequence of all prefixes of this sequence, shortest first. For example,
inits (fromList "abc") = fromList [fromList "", fromList "a", fromList "ab", fromList "abc"]
Evaluating the <math>th prefix takes <math>, but evaluating every prefix in the sequence takes <math> due to sharing.
O(n) Return all initial segments of the given Text, shortest first.