< 99 Elm Problems < Problem 15

Solution 1: Using List.foldr

repeatElements n = List.foldr (\a b -> List.repeat n a ++ b) []
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.