The .inserts obviously need an element, but why do the .removes also need an element?
(Note that it doesn't seem to matter what character I set the element of the .removes to, they are all spaces instead of "e", "e", "h" and "t" but it still works as expected.)
Typically you wouldn't construct a collection difference directly like this, you'd recover it from difference(from:), and there the element member of .remove would tell you which character is removed:
Yes. But I want to know why the element cannot be skipped for removals (maybe it could have been optional?) and if it’s ok to just use eg a space when for example implementing functionality for serializing character diffs to and from some compact representation.