Refactor, , . , . , , . , .
, . . hoogle, hackage, . :
replicate :: Int -> a -> [a]
replicate n x = take n (repeat x)
, . , :
myReplicate :: Int -> a -> [a]
myReplicate n x | n <= 0 = []
| otherwise = x : replicate (n-1) x
---------- ----------------
, , . , . , . , , , n. , map, filter, foldr .., , , .
, - , - , . , - - , . , , - .
, , Learn You a Haskell Real World Haskell, .