< 99 Elm Problems < Problem 21
Solution 1: Using List.take
and List.drop
insertAt n value list =
List.take (n-1) list ++ value :: List.drop (n-1) list
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.