Skip to content

Instantly share code, notes, and snippets.

@TheSeamau5
Created July 20, 2015 16:26
Show Gist options
  • Save TheSeamau5/e592a097fc7b2c04cd53 to your computer and use it in GitHub Desktop.
Save TheSeamau5/e592a097fc7b2c04cd53 to your computer and use it in GitHub Desktop.
UpdateN function
updateN : Int -> (a -> a) -> List a -> List a
updateN n f list =
List.indexedMap (\index value -> if index == n then f value else value) list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment