## Get suffixes <!-- language: lang-haskell --> Use `scanr(:)[]` to get the suffixes of a list: λ scanr(:)[] "abc" ["abc","bc","c",""] This is much shorter than `tails` after `import Data.List`. You can do prefixes with `scanl(\s c->s++[c])[]`. λ scanl(\s c->s++[c])[] "abc" ["","a","ab","abc"] This is longer but still beats the import. Pointfree is the same length: scanl((.pure).(++))[]