Last active
August 29, 2015 14:01
-
-
Save jdoiwork/df2db5ad5d2cc2a00d92 to your computer and use it in GitHub Desktop.
This file contains 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
{-# LANGUAGE RecordWildCards #-} | |
module Handler.Hoge where | |
import Import | |
-- ... | |
data Person = Person | |
{ name :: Text | |
, age :: Int | |
} | |
instance ToJSON Person where | |
toJSON Person {..} = object | |
[ "name" .= name | |
, "age" .= age | |
] | |
getPersonR :: Handler Value | |
getPersonR = returnJson $ [Person "Michael" 28] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment