{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ImpredicativeTypes #-} module Main (main) where import Thermoprint.Server import Thermoprint.Server.Printer.Debug import Control.Monad.Trans.Resource import Control.Monad.Logger import Control.Monad.Reader import Database.Persist.Sqlite main :: IO () main = thermoprintServer True (Nat runSqlite) $ def `withPrinters` printers where runSqlite :: ReaderT ConnectionPool (LoggingT IO) a -> IO a runSqlite = runStderrLoggingT . withSqlitePool "thermoprint.sqlite" 1 . runReaderT printers = [ (pure debugPrint, def) ]