Haskell 99 Problems - Number 14


/ Published in: Haskell
Save to your folder(s)

problem 14, Duplicate the elements of a list
> dupli [1, 2, 3]
[1,1,2,2,3,3]


Copy this code and paste it in your HTML
  1. dupli :: [a] -> [a]
  2. dupli = concatMap (replicate 2)

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.