Skip to content

Commit 250be8d

Browse files
committed
Give User ToJSON instance for as yet unknown reasons
1 parent 1cfca98 commit 250be8d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

how-does-servants-type-dsl-work.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ maintainer: hi@bradparker.com
99
executable server
1010
main-is: Main.hs
1111
build-depends: base ^>=4.12.0.0
12+
, aeson
1213
, servant-server
1314
, time
1415
, wai

src/Main.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
module Main where
88

9+
import Data.Aeson (ToJSON)
910
import Data.Proxy (Proxy(Proxy))
1011
import Data.Time (Day)
1112
import GHC.Generics (Generic)
@@ -28,6 +29,8 @@ data User = User
2829
, registrationDate :: Day
2930
} deriving (Generic)
3031

32+
instance ToJSON User
33+
3134
type UsersIndex =
3235
Get '[JSON] [User]
3336

0 commit comments

Comments
 (0)