[Haskell-cafe] Lists of Lists
robdockins at fastmail.fm
Wed Mar 8 15:27:14 EST 2006
On Mar 8, 2006, at 2:27 PM, zell_ffhut wrote:
> Could you explain what the function does.. I can't seem to peice it
It takes three things 1) a function 2) an index and 3) a list. It
finds the nth element of the list, applies the function to it and
then returns a new list containing the new element in the same
position. It dies with an error message if you index past the end of
updateList (\x -> x + 10) 3 [0,1,2,3,4,5] == [0,1,2,13,4,5]
Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
More information about the Haskell-Cafe