aboutsummaryrefslogtreecommitdiff
path: root/server/src/Thermoprint/Server/Printer
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-25 13:25:18 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-25 13:25:18 +0000
commit9d9bad89241bfa14255361dd8452ad40291a9684 (patch)
tree5e0f940724f060fb732c36e81217b10c5eb69229 /server/src/Thermoprint/Server/Printer
parent09f4d0431ef3015653b6b78f1d413454519380bd (diff)
downloadthermoprint-9d9bad89241bfa14255361dd8452ad40291a9684.tar
thermoprint-9d9bad89241bfa14255361dd8452ad40291a9684.tar.gz
thermoprint-9d9bad89241bfa14255361dd8452ad40291a9684.tar.bz2
thermoprint-9d9bad89241bfa14255361dd8452ad40291a9684.tar.xz
thermoprint-9d9bad89241bfa14255361dd8452ad40291a9684.zip
Cleaned up printer declaration
Diffstat (limited to 'server/src/Thermoprint/Server/Printer')
-rw-r--r--server/src/Thermoprint/Server/Printer/Debug.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/server/src/Thermoprint/Server/Printer/Debug.hs b/server/src/Thermoprint/Server/Printer/Debug.hs
index b8c1430..721ec84 100644
--- a/server/src/Thermoprint/Server/Printer/Debug.hs
+++ b/server/src/Thermoprint/Server/Printer/Debug.hs
@@ -1,11 +1,8 @@
1{-# LANGUAGE OverloadedStrings #-} 1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE RankNTypes #-}
3{-# LANGUAGE TemplateHaskell #-} 2{-# LANGUAGE TemplateHaskell #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE FlexibleInstances #-}
6 3
7module Thermoprint.Server.Printer.Debug 4module Thermoprint.Server.Printer.Debug
8 ( Debug(..) 5 ( debugPrint
9 ) where 6 ) where
10 7
11import Control.Monad.IO.Class 8import Control.Monad.IO.Class
@@ -24,13 +21,8 @@ import Data.List (intersperse)
24import Data.Foldable (toList) 21import Data.Foldable (toList)
25import Data.Monoid 22import Data.Monoid
26 23
27data Debug = Debug 24debugPrint :: PrinterMethod
28 25debugPrint = PM $ (>> return Nothing) . $(logDebugS) "Printer.Debug" . T.pack . show . cotext'
29instance Applicative m => IsPrinter Debug m where
30 printMethod _ = printMethod debugPrinter
31
32debugPrinter :: PrinterMethod
33debugPrinter = PM $ (>> return Nothing) . $(logDebugS) "Printer.Debug" . T.pack . show . cotext'
34 26
35cotext' :: Printout -> Text 27cotext' :: Printout -> Text
36cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList) . toList 28cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList) . toList