Created
July 20, 2015 16:26
-
-
Save TheSeamau5/e592a097fc7b2c04cd53 to your computer and use it in GitHub Desktop.
UpdateN function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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