{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeOperators #-} module Main where import Control.Monad.App import Data.Config import Data.Language import qualified Data.Text.IO as T import Network.HTTP.Client.TLS (newTlsManager) import Options.Generic import Servant.Client import Server newtype Cmd = Cmd (FilePath "Config path") deriving Generic instance ParseRecord Cmd main :: IO () main = do Cmd (Helpful configPath) <- getRecord "koodihaaste" _config <- readConfigFromFile configPath manager <- newTlsManager _languageModel <- buildModel <$> T.readFile (_training _config) let state = App{..} _solidabisClient = ClientEnv manager (_solidabisBase _config) Nothing runAppM state server