Repeat a string: Difference between revisions

(→‎{{header|Haskell}}: For higher numbers of repetitions, Rhind Papyrus 'Egyptian' or 'Ethiopian' multiplication may be more efficient.)
Line 818:
import Control.Monad (join)
 
-- BY RHIND PAPYRUS 'EGYPTIAN' OR 'ETHIOPIAN' MULTIPLICATION ---------------------------------------------------
repString :: Int -> String -> String
repString n m =
Line 826:
then mappend a x
else a)
""mempty $
zip
(unfoldr
Line 838:
-- TEST -----------------------------------------------------------------------
main :: IO ()
main = print $ repString 50000500 "ha"</lang>
 
=={{header|HicEst}}==
9,659

edits