Defining an “mempty”-like function with GHC Generics?
问题 I am writing a client library for the Zoho REST API and have a bunch of different record types that have all Maybe a fields, i.e: data Approval = Approval { apDelegate :: Maybe Bool , apApprove :: Maybe Bool , apReject :: Maybe Bool , apResubmit :: Maybe Bool } deriving (Eq, Show, Generic) data ContactSpecialFields = ContactSpecialFields { csfCurrencySymbol :: Maybe Text -- $currency_symbol , csfState :: Maybe Text -- $state , csfProcessFlow :: Maybe Bool -- $process_flow , csfApproved ::