setIndex :: Int -> (a -> a) -> [a] -> [a]
setIndex idx' f xs =
  map
   (
    \(i,e) -> if (i == idx')
                 then f e
                 else e
   )
   (zip [0..] xs)
setIndex :: Int -> (a -> a) -> [a] -> [a]
setIndex idx' f xs =
  map
   (
    \(i,e) -> if (i == idx')
                 then f e
                 else e
   )
   (zip [0..] xs)
setIndex idx' f xs =
  map
   (
    \(i,e) -> if (i == idx')
                 then f e
                 else e
   )
   (zip [0..] xs)