i am trying to write a very simple function in haskell to change a value in a list depending on an input as follows
update_game :: [Int] -> Int -> Int -> [Int]
update_game (x:xs) row take_amnt | row == 1 = x - take_amnt:xs
| row == 2 = x : head(xs) - take_amnt : tail(xs)
| row == 3 = x : head(xs) : last(xs) - take_amnt`
the first two cases work fine, however the last case is causing me problems and im not sure why, the errors i get are :