diff options
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang/API.hs')
| -rw-r--r-- | lambda-calcul/haskell/src/Minilang/API.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lambda-calcul/haskell/src/Minilang/API.hs b/lambda-calcul/haskell/src/Minilang/API.hs new file mode 100644 index 0000000..65e652a --- /dev/null +++ b/lambda-calcul/haskell/src/Minilang/API.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DeriveAnyClass #-} + +module Minilang.API where + +import Data.Time (UTCTime) +import Servant (Get, JSON, (:>)) +import GHC.Generics (Generic) +import Data.Aeson (ToJSON, FromJSON) + +data Score = Score + { name :: String, + grade :: Int, + lastTest :: UTCTime + } + deriving (Eq, Show, Generic, ToJSON, FromJSON) + +type LambdaAPI = "api" :> "leaderboard" :> Get '[JSON] [Score] |
