:: [x] -> x -> [x] package:deriving-compat

Replace the last element of a list with another element.