Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c22582cbeb
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (9 sloc) 0.248 kb
dupli = concatMap (\x -> [x,x])
----
-- use list comprehension
dupli' xs = concat [[x,x] | x <- xs]
-- the direct solution
dupli'' [] = []
dupli'' (x:xs) = x:x:dupli' xs
-- the direct solution using foldr
dupli''' = foldr (\x xs -> x:x:xs) []
Jump to Line
Something went wrong with that request. Please try again.