git.iko.soy
/
servant
readme
files
commits
refs
on
master
help
sign in
Use aeson's Day instance
afc0f31
Julian K. Arni
11 years ago
servant-examples/servant-examples.cabal
+1
−1
compare with master
unified
split
@@ -21,7 +21,7 @@ executable tutorial
21
main-is: tutorial.hs
21
main-is: tutorial.hs
22
other-modules: T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
22
other-modules: T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
23
build-depends:
23
build-depends:
24
−
aeson >= 0.
8
24
+
aeson >= 0.
10
25
, base >= 4.7 && < 5
25
, base >= 4.7 && < 5
26
, bytestring
26
, bytestring
27
, directory
27
, directory
servant-examples/tutorial/T2.hs
−5
@@ -17,11 +17,6 @@ data User = User
17
, registration_date ::
Day
17
, registration_date ::
Day
18
}
deriving
(Eq, Show, Generic)
18
}
deriving
(Eq, Show, Generic)
19
19
20
−
-- orphan ToJSON instance for Day. necessary to derive one for User
21
−
instance
ToJSON Day
where
22
−
-- display a day in YYYY-mm-dd format
23
−
toJSON d = toJSON (showGregorian d)
24
−
25
instance
ToJSON User
20
instance
ToJSON User
26
21
27
type
UserAPI
=
"users"
:>
Get
'[
JSON
] [
User
]
22
type
UserAPI
=
"users"
:>
Get
'[
JSON
] [
User
]
keys
esc to close
j k
move down, up
enter
open
esc
back, or up a level
1 2 3 4
readme, files, commits, refs
/
filter
y
copy the clone command
c
compare the chosen commit with another (or shift-click both)
?
show or hide this list