let last_of_diff d = match d with Add (_,i,_) -> last_of_index i | Delete (i2,i,_) | Change (i2,_,i,_) -> (last_of_index i) + (range_of_index i2)