aboutsummaryrefslogtreecommitdiff
path: root/server/src/Thermoprint/Server/Printer/Generic.hs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/Thermoprint/Server/Printer/Generic.hs')
-rw-r--r--server/src/Thermoprint/Server/Printer/Generic.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/Thermoprint/Server/Printer/Generic.hs b/server/src/Thermoprint/Server/Printer/Generic.hs
index ce818ee..441c74d 100644
--- a/server/src/Thermoprint/Server/Printer/Generic.hs
+++ b/server/src/Thermoprint/Server/Printer/Generic.hs
@@ -63,10 +63,10 @@ import Prelude hiding (mapM_, sequence_, lines)
63genericPrint :: FilePath -> PrinterMethod 63genericPrint :: FilePath -> PrinterMethod
64genericPrint path = PM $ genericPrint' path 64genericPrint path = PM $ genericPrint' path
65 65
66genericPrint' :: (MonadIO m, MonadMask m, MonadLogger m) => FilePath -> Printout -> m (Maybe PrintingError) 66genericPrint' :: (MonadIO m, MonadMask m, MonadLogger m, MonadUnliftIO m) => FilePath -> Printout -> m (Maybe PrintingError)
67genericPrint' path = flip catches handlers . withFile path . print 67genericPrint' path = flip catches handlers . withFile path . print
68 where 68 where
69 withFile path f = flip withEx f $ mkAcquire (openFile path WriteMode >>= (\h -> h <$ hSetBuffering h NoBuffering)) hClose 69 withFile path f = flip with f $ mkAcquire (openFile path WriteMode >>= (\h -> h <$ hSetBuffering h NoBuffering)) hClose
70 handlers = [ Handler $ return . Just . IOError . (show :: IOException -> String) 70 handlers = [ Handler $ return . Just . IOError . (show :: IOException -> String)
71 , Handler $ return . Just . EncError 71 , Handler $ return . Just . EncError
72 , Handler $ return . Just 72 , Handler $ return . Just