ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: List
Function: inits
Type: [a] -> [[a]]
Description: returns the list of initial segments of its argument list, shortest first
Related: group, groupBy, intersperse, mapAccumL, mapAccumR, nub, nubBy, partition, sort, sortBy, tails, transpose

Example 1

Input: inits [1,3,5]

Output: [[],[1],[1,3],[1,3,5]]

Example 2

Input: inits "XXX"

Output: ["","X","XX","XXX"]