| 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: | Prelude |
|---|---|
| Function: | replicate |
| Type: | Int -> a -> [a] |
| Description: | creates a list of length given by the first argument and the items having value of the second argument |
| Related: | cycle, iterate, repeat, take |
Input: replicate 3 5
Output: [5,5,5]
Input: replicate 5 "aa"
Output: ["aa","aa","aa","aa","aa"]
Input: replicate 5 'a'
Output: "aaaaa"