summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/src/Minilang/App.hs
blob: 2d21961aa25382c440ac707e4c49ddc322344fc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Minilang.App where

import Minilang.API (LambdaAPI, Score (..))
import Servant.Server (Handler, Server)
import Data.Time (getCurrentTime)
import Control.Monad.IO.Class (liftIO)

lambdaApp :: Server LambdaAPI
lambdaApp = getLeaderboard

getLeaderboard :: Handler [Score]
getLeaderboard = do
  now <- liftIO getCurrentTime
  pure [Score "Alice" 95 now, Score "Bob" 88 now]