99 Elm Problems/Problem 21/Solutions

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Solution 1: Using List.take and List.drop

insertAt n value list =
  List.take (n-1) list ++ value :: List.drop (n-1) list