repos / handle-examples.hs.git


handle-examples.hs.git / simple-handle / domain
Evgenii Akentev  ·  2021-01-05

WeatherProvider.hs

 1module WeatherProvider where
 2
 3type Temperature = Int
 4data WeatherData = WeatherData { temperature :: Temperature }
 5
 6type Location = String
 7type Day = String
 8
 9-- | Our Handle is empty, but usually other dependencies are stored here
10data Handle = Handle
11
12-- | Constructor for Handle
13new :: Handle
14new = Handle
15
16-- | This is some concrete implementation.
17-- In this example we return a constant value.
18getWeatherData :: Handle -> Location -> Day -> IO WeatherData
19getWeatherData _ _ _ = return $ WeatherData 30