Skip to content
Permalink
Browse files

Add fields and Generic instance to User

  • Loading branch information...
bradparker committed Oct 2, 2019
1 parent 0f89c43 commit 07e9d5069e64f52dbf3447557b847abdbdb94fdf
Showing with 10 additions and 0 deletions.
  1. +1 −0 how-does-servants-type-dsl-work.cabal
  2. +9 −0 src/Main.hs
@@ -10,5 +10,6 @@ executable server
main-is: Main.hs
build-depends: base ^>=4.12.0.0
, servant-server
, time
hs-source-dirs: src
default-language: Haskell2010
@@ -1,9 +1,12 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wall #-}

module Main where

import Data.Time (Day)
import GHC.Generics (Generic)
import Servant
( (:<|>)
, (:>)
@@ -13,6 +16,12 @@ import Servant
)

data User = User
{ name :: String
, age :: Int
, email :: String
, username :: String
, registrationDate :: Day
} deriving (Generic)

type UsersIndex =
Get '[JSON] [User]

0 comments on commit 07e9d50

Please sign in to comment.
You can’t perform that action at this time.