Another Day instance removed
This commit is contained in:
parent
afc0f31f91
commit
ef3cf9f757
1 changed files with 1 additions and 6 deletions
|
@ -17,17 +17,12 @@ data User = User
|
||||||
, registration_date :: Day
|
, registration_date :: Day
|
||||||
} deriving (Eq, Show, Generic)
|
} deriving (Eq, Show, Generic)
|
||||||
|
|
||||||
-- orphan ToJSON instance for Day. necessary to derive one for User
|
|
||||||
instance ToJSON Day where
|
|
||||||
-- display a day in YYYY-mm-dd format
|
|
||||||
toJSON d = toJSON (showGregorian d)
|
|
||||||
|
|
||||||
instance ToJSON User
|
instance ToJSON User
|
||||||
|
|
||||||
type UserAPI = "users" :> Get '[JSON] [User]
|
type UserAPI = "users" :> Get '[JSON] [User]
|
||||||
|
|
||||||
users :: [User]
|
users :: [User]
|
||||||
users =
|
users =
|
||||||
[ User "Isaac Newton" 372 "isaac@newton.co.uk" (fromGregorian 1683 3 1)
|
[ User "Isaac Newton" 372 "isaac@newton.co.uk" (fromGregorian 1683 3 1)
|
||||||
, User "Albert Einstein" 136 "ae@mc2.org" (fromGregorian 1905 12 1)
|
, User "Albert Einstein" 136 "ae@mc2.org" (fromGregorian 1905 12 1)
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue