Last active
April 27, 2019 13:52
-
-
Save mrehayden1/801f62fa621de17fe05ca41d76d80abe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Country = US | |
deriving (Eq, Generic, Read, Show, Typeable) | |
instance ToJSON Country where | |
toEncoding = genericToEncoding $ defaultOptions { | |
constructorTagModifier = fmap toLower | |
} | |
instance FromJSON Country where | |
parseJSON = genericParseJSON $ defaultOptions { | |
constructorTagModifier = fmap toUpper | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment