From c3a6d0657eb2987aa13b53419269274d848d9e0c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 24 Jan 2016 16:10:48 +0000 Subject: Working printer config & debug printer --- server/default-conf/Main.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'server/default-conf') diff --git a/server/default-conf/Main.hs b/server/default-conf/Main.hs index 0aa7d91..0fba774 100644 --- a/server/default-conf/Main.hs +++ b/server/default-conf/Main.hs @@ -1,9 +1,12 @@ -{-# LANGUAGE OverloadedStrings #-} +{-# 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 @@ -11,7 +14,10 @@ import Control.Monad.Reader import Database.Persist.Sqlite main :: IO () -main = thermoprintServer (Nat runSqlite) def +main = thermoprintServer (Nat runSqlite) $ def `withPrinters` printers where - runSqlite :: ReaderT ConnectionPool (LoggingT (ResourceT IO)) a -> IO a - runSqlite = runResourceT . runStderrLoggingT . withSqlitePool ":memory:" 1 . runReaderT + runSqlite :: ReaderT ConnectionPool (LoggingT IO) a -> IO a + runSqlite = runStderrLoggingT . withSqlitePool ":memory:" 1 . runReaderT + + printers = [ PS Debug + ] -- cgit v1.2.3