diff options
Diffstat (limited to 'server/src/Thermoprint/Server/Printer.hs')
| -rw-r--r-- | server/src/Thermoprint/Server/Printer.hs | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/server/src/Thermoprint/Server/Printer.hs b/server/src/Thermoprint/Server/Printer.hs index 0db98a0..f34b2fa 100644 --- a/server/src/Thermoprint/Server/Printer.hs +++ b/server/src/Thermoprint/Server/Printer.hs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} | 8 | {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} | 
| 9 | 9 | ||
| 10 | module Thermoprint.Server.Printer | 10 | module Thermoprint.Server.Printer | 
| 11 | ( Printer(..) | 11 | ( Printer(..), printer | 
| 12 | , Queue(..) | 12 | , Queue(..) | 
| 13 | , runPrinter | 13 | , runPrinter | 
| 14 | ) where | 14 | ) where | 
| @@ -54,6 +54,9 @@ data Queue = Queue | |||
| 54 | } | 54 | } | 
| 55 | deriving (Typeable, Generic, NFData) | 55 | deriving (Typeable, Generic, NFData) | 
| 56 | 56 | ||
| 57 | printer :: (MonadIO m) => (forall m. (MonadIO m) => Printout -> m (Maybe PrintingError)) -> m Printer | ||
| 58 | printer f = Printer f <$> liftIO (newTVarIO $ Queue Seq.empty Nothing Seq.empty) | ||
| 59 | |||
| 57 | atomically' :: MonadIO m => STM a -> m a | 60 | atomically' :: MonadIO m => STM a -> m a | 
| 58 | atomically' = liftIO . atomically | 61 | atomically' = liftIO . atomically | 
| 59 | 62 | ||
