haskell recursive function

Posted by snorlaks on Stack Overflow See other posts from Stack Overflow or by snorlaks
Published on 2010-05-01T12:51:14Z Indexed on 2010/05/01 12:57 UTC
Read the original article Hit count: 288

Filed under:
|
|

Hello,

Please help me with writing function which takes two arguments : list of ints and index (int) and returns list of integers with negative of value on specified index position in the table

MyReverse :: [Int]->Int->[Int]

for example

myReverse [1,2,3,4,5] 3 = [1,2,-3,4,5]

if index is bigger then length of the list or smaller then 0 return the same list.

Thanks for help

© Stack Overflow or respective owner

Related posts about haskell

Related posts about list