Skip to content

Commit

Permalink
Give User ToJSON instance for as yet unknown reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
bradparker committed Oct 2, 2019
1 parent 1cfca98 commit 250be8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions how-does-servants-type-dsl-work.cabal
Expand Up @@ -9,6 +9,7 @@ maintainer: hi@bradparker.com
executable server
main-is: Main.hs
build-depends: base ^>=4.12.0.0
, aeson
, servant-server
, time
, wai
Expand Down
3 changes: 3 additions & 0 deletions src/Main.hs
Expand Up @@ -6,6 +6,7 @@

module Main where

import Data.Aeson (ToJSON)
import Data.Proxy (Proxy(Proxy))
import Data.Time (Day)
import GHC.Generics (Generic)
Expand All @@ -28,6 +29,8 @@ data User = User
, registrationDate :: Day
} deriving (Generic)

instance ToJSON User

type UsersIndex =
Get '[JSON] [User]

Expand Down

0 comments on commit 250be8d

Please sign in to comment.