Repeat a string: Difference between revisions

→‎{{header|Haskell}}: For an infinitely long string…
(→‎{{header|C++}}: avoid repeated reallocation)
(→‎{{header|Haskell}}: For an infinitely long string…)
Line 87:
 
=={{header|Haskell}}==
For a string of finite length:
 
<lang haskell>concat $ replicate 5 "ha"</lang>
 
For an infinitely long string:
 
<lang haskell>cycle "ha"</lang>
 
=={{header|J}}==
845

edits