From c6be6366d6411d7b0b53fd8879537a33fefd5a88 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Sep 2021 23:03:56 +0200 Subject: use PrettyPrinter more --- lib/Util.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Util.hs') diff --git a/lib/Util.hs b/lib/Util.hs index 5cf27e3..47ee7f2 100644 --- a/lib/Util.hs +++ b/lib/Util.hs @@ -9,7 +9,8 @@ module Util where import Data.Aeson as Aeson import Data.Text (Text) import qualified Data.Text as T -import Tiled2 (Layer (layerData), PropertyValue (..), mkTiledId) +import Tiled2 (Layer (layerData), PropertyValue (..), layerName, + mkTiledId) -- | haskell's many string types are FUN … showText :: Show a => a -> Text @@ -39,6 +40,9 @@ instance PrettyPrint PropertyValue where instance PrettyPrint () where prettyprint _ = error "shouldn't pretty-print Unit" +instance PrettyPrint Layer where + prettyprint = (<>) "layer " . layerName + printPretty :: PrettyPrint a => a -> IO () printPretty = putStr . T.unpack . prettyprint -- cgit v1.2.3