diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-03-01 07:34:23 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-03-01 07:34:23 +0100 |
commit | 61c983bd242ec45726ce572e85c069ca9274c71e (patch) | |
tree | 2bd74a9c80dd4f5c9e8a061894958cd9d19680b4 /tprint/src/Instances.hs | |
parent | fc83a7241e27574ef2bb81de206c59a9a854efe6 (diff) | |
download | thermoprint-61c983bd242ec45726ce572e85c069ca9274c71e.tar thermoprint-61c983bd242ec45726ce572e85c069ca9274c71e.tar.gz thermoprint-61c983bd242ec45726ce572e85c069ca9274c71e.tar.bz2 thermoprint-61c983bd242ec45726ce572e85c069ca9274c71e.tar.xz thermoprint-61c983bd242ec45726ce572e85c069ca9274c71e.zip |
Cleanup
Diffstat (limited to 'tprint/src/Instances.hs')
-rw-r--r-- | tprint/src/Instances.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tprint/src/Instances.hs b/tprint/src/Instances.hs new file mode 100644 index 0000000..cffb8b0 --- /dev/null +++ b/tprint/src/Instances.hs | |||
@@ -0,0 +1,25 @@ | |||
1 | module Instances where | ||
2 | |||
3 | import Data.Text (Text) | ||
4 | import qualified Data.Text as T (unpack) | ||
5 | |||
6 | import Data.Time (UTCTime, formatTime, defaultTimeLocale) | ||
7 | |||
8 | import Text.Show.Pretty (Value, PrettyVal(..), dumpStr) | ||
9 | import qualified Text.Show.Pretty as PShow (Value(..)) | ||
10 | |||
11 | import Thermoprint.Client (Scheme(..), BaseUrl(..), PrinterId(..), JobId(..), DraftId(..), Range(..)) | ||
12 | |||
13 | instance PrettyVal Scheme | ||
14 | instance PrettyVal BaseUrl | ||
15 | instance PrettyVal PrinterId | ||
16 | instance PrettyVal JobId | ||
17 | instance PrettyVal DraftId | ||
18 | instance PrettyVal a => PrettyVal (Range a) | ||
19 | |||
20 | instance PrettyVal UTCTime where | ||
21 | prettyVal = PShow.String . formatTime defaultTimeLocale "%Z %F %X" | ||
22 | |||
23 | instance PrettyVal Text where | ||
24 | prettyVal = prettyVal . T.unpack | ||
25 | |||