aboutsummaryrefslogtreecommitdiff
path: root/tprint/src/Instances.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tprint/src/Instances.hs')
-rw-r--r--tprint/src/Instances.hs25
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 @@
1module Instances where
2
3import Data.Text (Text)
4import qualified Data.Text as T (unpack)
5
6import Data.Time (UTCTime, formatTime, defaultTimeLocale)
7
8import Text.Show.Pretty (Value, PrettyVal(..), dumpStr)
9import qualified Text.Show.Pretty as PShow (Value(..))
10
11import Thermoprint.Client (Scheme(..), BaseUrl(..), PrinterId(..), JobId(..), DraftId(..), Range(..))
12
13instance PrettyVal Scheme
14instance PrettyVal BaseUrl
15instance PrettyVal PrinterId
16instance PrettyVal JobId
17instance PrettyVal DraftId
18instance PrettyVal a => PrettyVal (Range a)
19
20instance PrettyVal UTCTime where
21 prettyVal = PShow.String . formatTime defaultTimeLocale "%Z %F %X"
22
23instance PrettyVal Text where
24 prettyVal = prettyVal . T.unpack
25