ZVON > References > Haskell reference |
Intro / Search / ZVON |
| 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 |
Input: inits [1,3,5]
Output: [[],[1],[1,3],[1,3,5]]
Input: inits "XXX"
Output: ["","X","XX","XXX"]