diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-23 19:42:22 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-23 19:42:22 +0000 |
commit | 6434397a3d103547b563ada27fd64c38cb05e1f0 (patch) | |
tree | 29e67e7a0804ca46467565c35dc3c15447bf814e /server/src/Thermoprint/Server/Printer | |
parent | 8553c33f72c41e553cbef4e7175cef8cec3cdbe2 (diff) | |
download | thermoprint-6434397a3d103547b563ada27fd64c38cb05e1f0.tar thermoprint-6434397a3d103547b563ada27fd64c38cb05e1f0.tar.gz thermoprint-6434397a3d103547b563ada27fd64c38cb05e1f0.tar.bz2 thermoprint-6434397a3d103547b563ada27fd64c38cb05e1f0.tar.xz thermoprint-6434397a3d103547b563ada27fd64c38cb05e1f0.zip |
Broken existentially quantified printer config
Diffstat (limited to 'server/src/Thermoprint/Server/Printer')
-rw-r--r-- | server/src/Thermoprint/Server/Printer/Debug.hs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/server/src/Thermoprint/Server/Printer/Debug.hs b/server/src/Thermoprint/Server/Printer/Debug.hs new file mode 100644 index 0000000..81e43a3 --- /dev/null +++ b/server/src/Thermoprint/Server/Printer/Debug.hs | |||
@@ -0,0 +1,32 @@ | |||
1 | {-# LANGUAGE EmptyDataDecls #-} | ||
2 | {-# LANGUAGE OverloadedStrings #-} | ||
3 | {-# LANGUAGE RankNTypes #-} | ||
4 | |||
5 | module Thermoprint.Server.Printer.Debug | ||
6 | ( Debug | ||
7 | ) where | ||
8 | |||
9 | import Control.Monad.IO.Class | ||
10 | import Control.Monad.Trans.Resource | ||
11 | |||
12 | import Data.Text.Lazy (Text) | ||
13 | import qualified Data.Text.Lazy as TL | ||
14 | import qualified Data.Text.Lazy.IO as TL | ||
15 | |||
16 | import Thermoprint.Printout | ||
17 | import Thermoprint.Server.Printer | ||
18 | |||
19 | import Data.List (intersperse) | ||
20 | import Data.Foldable (toList) | ||
21 | import Data.Monoid | ||
22 | |||
23 | data Debug | ||
24 | |||
25 | -- instance IsPrinter Debug where | ||
26 | -- toMethod _ = (>> return Nothing) . liftIO . TL.putStrLn . cotext' | ||
27 | |||
28 | -- cotext' :: Printout -> Text | ||
29 | -- cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList) . toList | ||
30 | -- where | ||
31 | -- cotext'' (Cooked b) = cotext b | ||
32 | -- cotext'' (Raw _) = "[Raw]" | ||