Using the aeson deriveJSON it is easily to omit Nothing values, e.g.:
data Person =
Person {
ssn :: Maybe Text,
phone :: [Text]
}
$(deriveJSON defaultOptions{omitNothingFields=True} ''Person)
I would like to also omit empty lists in order to keep the JSON compact. Is there a general to omit empty lists using deriveJSON, without hand rolling instances?