411 REFERENCE · Wikibooks
99 Elm Problems/Problem 14/Solutions
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Solution 1: Recursive version
duplicate list =
case list of
[] -> []
x :: xs -> x :: x :: duplicate xs
Solution 2: Pointfree, using List.foldr
duplicate = List.foldr (\x xs -> x :: x :: xs) []