:: [a] -> a -> [a] package:ghc-lib-parser

Replace the last element of a list with another element.