repos / handle-examples.hs.git


handle-examples.hs.git / row-handle / domain
Evgenii Akentev  ·  2021-09-08

WindProvider.hs

 1{-# LANGUAGE DataKinds #-}
 2{-# LANGUAGE OverloadedStrings #-}
 3{-# LANGUAGE TypeApplications #-}
 4{-# LANGUAGE TypeOperators #-}
 5
 6module WindProvider where
 7
 8import Data.Row
 9import HandleRow
10import QueryTypes
11
12type WindSpeed = Int
13
14type Methods = "getWindData" .== (Location -> Day -> IO WindSpeed)
15
16type Handle = HandleRow Methods
17
18getWindData :: Handle -> Location -> Day -> IO WindSpeed
19getWindData = getMethod @"getWindData"