Posted By

rtperson on 08/18/11


Tagged

lists


Versions (?)

Haskell 99 Problems - Number 14


 / Published in: Haskell
 

URL: http://haskell.org/haskellwiki/99_questions/11_to_20

problem 14, Duplicate the elements of a list

dupli [1, 2, 3] [1,1,2,2,3,3]

  1. dupli :: [a] -> [a]
  2. dupli = concatMap (replicate 2)

Report this snippet  

You need to login to post a comment.