diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-18 15:04:19 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-18 15:04:19 +0100 |
commit | a805783f4bb2868e63ba49a911775fff30df5a07 (patch) | |
tree | 130c8ef970f9489876d0667eff25444a0816c41a /client | |
parent | c88197535f7a4c13b7464a785881a91a67ebd15b (diff) | |
download | thermoprint-a805783f4bb2868e63ba49a911775fff30df5a07.tar thermoprint-a805783f4bb2868e63ba49a911775fff30df5a07.tar.gz thermoprint-a805783f4bb2868e63ba49a911775fff30df5a07.tar.bz2 thermoprint-a805783f4bb2868e63ba49a911775fff30df5a07.tar.xz thermoprint-a805783f4bb2868e63ba49a911775fff30df5a07.zip |
Introduced Range
Diffstat (limited to 'client')
-rw-r--r-- | client/src/Thermoprint/Client.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/client/src/Thermoprint/Client.hs b/client/src/Thermoprint/Client.hs index 80045dd..2b99e7e 100644 --- a/client/src/Thermoprint/Client.hs +++ b/client/src/Thermoprint/Client.hs | |||
@@ -45,10 +45,8 @@ data Client m = Client | |||
45 | { printers :: EitherT ServantError m (Map PrinterId PrinterStatus) | 45 | { printers :: EitherT ServantError m (Map PrinterId PrinterStatus) |
46 | -- ^ List all printers | 46 | -- ^ List all printers |
47 | , jobs :: Maybe PrinterId | 47 | , jobs :: Maybe PrinterId |
48 | -> Maybe JobId | 48 | -> Maybe (Range (JobId)) |
49 | -> Maybe JobId | 49 | -> Maybe (Range (UTCTime)) |
50 | -> Maybe UTCTime | ||
51 | -> Maybe UTCTime | ||
52 | -> EitherT ServantError m (Seq (JobId, UTCTime, JobStatus)) | 50 | -> EitherT ServantError m (Seq (JobId, UTCTime, JobStatus)) |
53 | -- ^ @jobs p minId maxId minTime maxTime@ lists a selection of jobs | 51 | -- ^ @jobs p minId maxId minTime maxTime@ lists a selection of jobs |
54 | , jobCreate :: Maybe PrinterId -> Printout -> EitherT ServantError m JobId | 52 | , jobCreate :: Maybe PrinterId -> Printout -> EitherT ServantError m JobId |
@@ -79,6 +77,7 @@ data Client m = Client | |||
79 | } | 77 | } |
80 | 78 | ||
81 | withArgs :: (x -> a :<|> b) -> ((x -> a) :<|> (x -> b)) | 79 | withArgs :: (x -> a :<|> b) -> ((x -> a) :<|> (x -> b)) |
80 | -- ^ Undo factoring of APIs | ||
82 | withArgs subAPI = (\(a :<|> _) -> a) . subAPI :<|> (\(_ :<|> b) -> b) . subAPI | 81 | withArgs subAPI = (\(a :<|> _) -> a) . subAPI :<|> (\(_ :<|> b) -> b) . subAPI |
83 | 82 | ||
84 | mkClient :: (IO :~> m) -- ^ A monad functor ('Nat') used to make the api functions work in any monad which can be constructed from 'IO' | 83 | mkClient :: (IO :~> m) -- ^ A monad functor ('Nat') used to make the api functions work in any monad which can be constructed from 'IO' |