From b519427c4e02671dffa24aa6e6ddf536480fb9d4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 9 Mar 2017 21:30:10 +0100 Subject: Add types to thermoprint-server --- bragi/thermoprint-server/thermoprint-server.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bragi/thermoprint-server/thermoprint-server.hs b/bragi/thermoprint-server/thermoprint-server.hs index 4f909f80..6142e7d9 100644 --- a/bragi/thermoprint-server/thermoprint-server.hs +++ b/bragi/thermoprint-server/thermoprint-server.hs @@ -13,12 +13,15 @@ import Control.Monad.Reader import Database.Persist.Postgresql +type ServerM = ReaderT ConnectionPool (LoggingT IO) + main :: IO () main = thermoprintServer True (Nat runDb) $ (\c -> c { queueManagers = queueManagers }) <$> def `withPrinters` printers where - runDb :: ReaderT ConnectionPool (LoggingT IO) a -> IO a + runDb :: ServerM a -> IO a runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT + printers :: [(ResourceT ServerM PrinterMethod, QMConfig (ResourceT ServerM))] printers = [ (pure $ genericPrint "/dev/usb/lp0", def) ] -- cgit v1.2.3