From 51194425997225de7b7ca83e26b76b9a82f0e10d Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Tue, 4 Nov 2025 08:09:35 +0100 Subject: Scaffold RESTish API for challenge --- lambda-calcul/haskell/src/Minilang/API.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lambda-calcul/haskell/src/Minilang/API.hs (limited to 'lambda-calcul/haskell/src/Minilang/API.hs') 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] -- cgit v1.3.1