When semigroupally combining Ini values that both define the same section, I was surprised to find that one of the sections is discarded. The monoid instance currently looks like this:
mappend x y = Ini {iniGlobals = mempty, iniSections = iniSections x <> iniSections y}
I was expecting sections of the same name to be merged.
Also, why discard all the globals?
Proposed change to the monoid instance:
mappend x y = Ini {
iniGlobals = Map.unionWith (<>) (iniGlobals x) (iniGlobals y),
iniSections = Map.unionWith (<>) (iniSections x) (iniSections y) }
Either way, whether you are interested in changing the instance or not, I'd be happy to send a PR with some documentation to mention how the instance behaves.
When semigroupally combining
Ini
values that both define the same section, I was surprised to find that one of the sections is discarded. The monoid instance currently looks like this:I was expecting sections of the same name to be merged.
Also, why discard all the globals?
Proposed change to the monoid instance:
Either way, whether you are interested in changing the instance or not, I'd be happy to send a PR with some documentation to mention how the instance behaves.