:: (a -> a) -> [a] -> [a] package:Agda

Update the first element of a list, if it exists. O(1).
Update the last element of a list, if it exists. O(n).