From 6434397a3d103547b563ada27fd64c38cb05e1f0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 23 Jan 2016 19:42:22 +0000 Subject: Broken existentially quantified printer config --- server/src/Thermoprint/Server/Printer/Debug.hs | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 server/src/Thermoprint/Server/Printer/Debug.hs (limited to 'server/src/Thermoprint/Server/Printer') 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 @@ +{-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} + +module Thermoprint.Server.Printer.Debug + ( Debug + ) where + +import Control.Monad.IO.Class +import Control.Monad.Trans.Resource + +import Data.Text.Lazy (Text) +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.IO as TL + +import Thermoprint.Printout +import Thermoprint.Server.Printer + +import Data.List (intersperse) +import Data.Foldable (toList) +import Data.Monoid + +data Debug + +-- instance IsPrinter Debug where +-- toMethod _ = (>> return Nothing) . liftIO . TL.putStrLn . cotext' + +-- cotext' :: Printout -> Text +-- cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList) . toList +-- where +-- cotext'' (Cooked b) = cotext b +-- cotext'' (Raw _) = "[Raw]" -- cgit v1.2.3