Refactoring boilerplate from sum types

A simple demonstration of extracting boilerplate from Aeson code handling a Just and a Nothing case of a Maybe value.

This needed DRY’d up, so I decided to take advantage of the Monoid instance on lists to merge them after turning the Maybe value into a 1 or 0 kv-pair list. I could probably be more clever about this, so if anybody has suggestions I’d like to hear them.

I know this site is a bit of a disaster zone, but if you like my writing or think you could learn something useful from me, please take a look at the Haskell book I've been writing. There's a free sample available too!