aboutsummaryrefslogtreecommitdiff
path: root/server/src/Thermoprint/Server/Printer
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2016-07-17 19:21:56 +0200
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2016-07-17 19:21:56 +0200
commit2b9ceaead3f3cd80e973cccecb9a3eebc51154f7 (patch)
treedf2378943480647606b6a06f62c0f4b8b2ab406d /server/src/Thermoprint/Server/Printer
parentac4cf4a0a494eafe55364f816569c517684fdf32 (diff)
downloadthermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar
thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar.gz
thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar.bz2
thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar.xz
thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.zip
Fixes for GHC 8.0.1
Diffstat (limited to 'server/src/Thermoprint/Server/Printer')
-rw-r--r--server/src/Thermoprint/Server/Printer/Debug.hs2
-rw-r--r--server/src/Thermoprint/Server/Printer/Generic.hs4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/src/Thermoprint/Server/Printer/Debug.hs b/server/src/Thermoprint/Server/Printer/Debug.hs
index d7ee12a..b8580b8 100644
--- a/server/src/Thermoprint/Server/Printer/Debug.hs
+++ b/server/src/Thermoprint/Server/Printer/Debug.hs
@@ -26,7 +26,7 @@ debugPrint :: PrinterMethod
26debugPrint = PM $ (>> return Nothing) . $(logDebugS) "Printer.Debug" . T.pack . show . cotext' 26debugPrint = PM $ (>> return Nothing) . $(logDebugS) "Printer.Debug" . T.pack . show . cotext'
27 27
28cotext' :: Printout -> Text 28cotext' :: Printout -> Text
29cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList) . toList 29cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList . getChunks) . toList . getParagraphs
30 where 30 where
31 cotext'' (Cooked b) = cotext b 31 cotext'' (Cooked b) = cotext b
32 cotext'' (Raw _) = "[Raw]" 32 cotext'' (Raw _) = "[Raw]"
diff --git a/server/src/Thermoprint/Server/Printer/Generic.hs b/server/src/Thermoprint/Server/Printer/Generic.hs
index df84e06..f431e4f 100644
--- a/server/src/Thermoprint/Server/Printer/Generic.hs
+++ b/server/src/Thermoprint/Server/Printer/Generic.hs
@@ -114,10 +114,10 @@ intersperse' :: Monad m => m b -> (a -> m b) -> Seq a -> m ()
114intersperse' b f = sequence_ . intersperse b f 114intersperse' b f = sequence_ . intersperse b f
115 115
116render :: Printout -> Put 116render :: Printout -> Put
117render = intersperse' (newls' 2) renderPar 117render = intersperse' (newls' 2) renderPar . getParagraphs
118 118
119renderPar :: Paragraph -> Put 119renderPar :: Paragraph -> Put
120renderPar = mapM_ renderChunk 120renderPar = mapM_ renderChunk . getChunks
121 where 121 where
122 renderChunk (Raw bs) = mapM_ pushWord8 $ LBS.unpack bs 122 renderChunk (Raw bs) = mapM_ pushWord8 $ LBS.unpack bs
123 renderChunk (Cooked block) = renderDoc $ execState (renderBlock block) (initDoc width) 123 renderChunk (Cooked block) = renderDoc $ execState (renderBlock block) (initDoc width)