--------------------------------------------------------------------------------
-- Authors
--------------------------------------------------------------------------------
data Author = Author
{ authorName :: Text
, authorEmail :: Text
, authorGithub :: Maybe Text
, authorTwitter :: Maybe Text
, authorCorresponding :: Bool
}
toJSON Author{..} =
object [ "name" .= authorName
, "email" .= authorEmail
, "github" .= authorGithub
, "twitter" .= authorTwitter
, "corresponding" .= authorCorresponding
]
parseJSON = withObject "Author" $ \v -> Author
<$> v .: "name"
<*> v .: "email"
<*> v .:? "github"
<*> v .:? "twitter"
<*> v .: "corresponding"