Solution 1: Using List.foldr
List.foldr
repeatElements n = List.foldr (\a b -> List.repeat n a ++ b) []