From 61c983bd242ec45726ce572e85c069ca9274c71e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 1 Mar 2016 07:34:23 +0100 Subject: Cleanup --- tprint/src/Instances.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tprint/src/Instances.hs (limited to 'tprint/src/Instances.hs') 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 @@ +module Instances where + +import Data.Text (Text) +import qualified Data.Text as T (unpack) + +import Data.Time (UTCTime, formatTime, defaultTimeLocale) + +import Text.Show.Pretty (Value, PrettyVal(..), dumpStr) +import qualified Text.Show.Pretty as PShow (Value(..)) + +import Thermoprint.Client (Scheme(..), BaseUrl(..), PrinterId(..), JobId(..), DraftId(..), Range(..)) + +instance PrettyVal Scheme +instance PrettyVal BaseUrl +instance PrettyVal PrinterId +instance PrettyVal JobId +instance PrettyVal DraftId +instance PrettyVal a => PrettyVal (Range a) + +instance PrettyVal UTCTime where + prettyVal = PShow.String . formatTime defaultTimeLocale "%Z %F %X" + +instance PrettyVal Text where + prettyVal = prettyVal . T.unpack + -- cgit v1.2.3