replicate w c = fst (unfoldrN w (\u -> Just (u,u)) c)
replicate w c = unfoldr w (\u -> Just (u,u)) cThis implementation uses memset(3)
replicate w c = unfoldr w (\u -> Just (u,u)) c
>>> replicate 0 True [] >>> replicate (-1) True [] >>> replicate 4 True [True,True,True,True]
>>> replicate 3 "jobs!" "jobs!jobs!jobs!"
>>> replicate 10000 "" ""
>>> replicate 0 "nothing" ""
length (replicate n t) == max 0 n * length t
>>> replicate n = Stream.take n . Stream.repeatGenerate a stream of length n by repeating a value n times.