summaryrefslogtreecommitdiff
path: root/lib/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Util.hs')
-rw-r--r--lib/Util.hs6
1 files changed, 5 insertions, 1 deletions
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