[Haskell] Function to replace given element in list