I'm thinking:
maybe_update_header(r, name, fun)
update_header(r, name, default, fun)
update_header!(r, name, fun)
I don't like the maybe_ part though. Alternatively, in update_header/4 passing nil as default or returning nil from fun could mean don't add and delete the header respectively and so we don't need maybe_update_header/3. But we don't treat nil values like that anywhere else so not sure.
I'm thinking:
I don't like the maybe_ part though. Alternatively, in update_header/4 passing
nilasdefaultor returningnilfromfuncould mean don't add and delete the header respectively and so we don't need maybe_update_header/3. But we don't treatnilvalues like that anywhere else so not sure.