diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-09 21:30:10 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-09 21:30:10 +0100 |
commit | b519427c4e02671dffa24aa6e6ddf536480fb9d4 (patch) | |
tree | 567288c625b0fd9df7f900339f1e252477c712ae /bragi/thermoprint-server | |
parent | 69542f257e76eaa6840b06ec395c96f448d31279 (diff) | |
download | nixos-b519427c4e02671dffa24aa6e6ddf536480fb9d4.tar nixos-b519427c4e02671dffa24aa6e6ddf536480fb9d4.tar.gz nixos-b519427c4e02671dffa24aa6e6ddf536480fb9d4.tar.bz2 nixos-b519427c4e02671dffa24aa6e6ddf536480fb9d4.tar.xz nixos-b519427c4e02671dffa24aa6e6ddf536480fb9d4.zip |
Add types to thermoprint-server
Diffstat (limited to 'bragi/thermoprint-server')
-rw-r--r-- | bragi/thermoprint-server/thermoprint-server.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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 | |||
13 | 13 | ||
14 | import Database.Persist.Postgresql | 14 | import Database.Persist.Postgresql |
15 | 15 | ||
16 | type ServerM = ReaderT ConnectionPool (LoggingT IO) | ||
17 | |||
16 | main :: IO () | 18 | main :: IO () |
17 | main = thermoprintServer True (Nat runDb) $ (\c -> c { queueManagers = queueManagers }) <$> def `withPrinters` printers | 19 | main = thermoprintServer True (Nat runDb) $ (\c -> c { queueManagers = queueManagers }) <$> def `withPrinters` printers |
18 | where | 20 | where |
19 | runDb :: ReaderT ConnectionPool (LoggingT IO) a -> IO a | 21 | runDb :: ServerM a -> IO a |
20 | runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT | 22 | runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT |
21 | 23 | ||
24 | printers :: [(ResourceT ServerM PrinterMethod, QMConfig (ResourceT ServerM))] | ||
22 | printers = [ (pure $ genericPrint "/dev/usb/lp0", def) | 25 | printers = [ (pure $ genericPrint "/dev/usb/lp0", def) |
23 | ] | 26 | ] |
24 | 27 | ||