diff options
author | stuebinm | 2021-12-15 23:06:42 +0100 |
---|---|---|
committer | stuebinm | 2021-12-15 23:06:42 +0100 |
commit | c89872d393566ab414301cc84f30b8e8d08900b2 (patch) | |
tree | 711b1dea5d24aa83ea73b2ac51083059a1e4ece9 /lib/Util.hs | |
parent | 417087b147e193a92b21afa2932c367c42aab25b (diff) |
suggest setting map meta properties if not given
Diffstat (limited to 'lib/Util.hs')
-rw-r--r-- | lib/Util.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Util.hs b/lib/Util.hs index 1e5826c..a6c8354 100644 --- a/lib/Util.hs +++ b/lib/Util.hs @@ -39,13 +39,14 @@ instance PrettyPrint Aeson.Value where v -> (T.pack . show) v instance PrettyPrint t => PrettyPrint (Set t) where - prettyprint = T.intercalate ", " . fmap prettyprint . S.toList + prettyprint = prettyprint . S.toList instance PrettyPrint PropertyValue where prettyprint = \case - StrProp str -> str - BoolProp bool -> if bool then "true" else "false" - IntProp int -> showText int + StrProp str -> str + BoolProp bool -> if bool then "true" else "false" + IntProp int -> showText int + FloatProp float -> showText float -- | here since Unit is sometimes used as dummy type instance PrettyPrint () where @@ -57,6 +58,9 @@ instance PrettyPrint Layer where instance PrettyPrint Tileset where prettyprint = (<>) "tileset " . tilesetName +instance PrettyPrint a => PrettyPrint [a] where + prettyprint = T.intercalate ", " . fmap prettyprint + printPretty :: PrettyPrint a => a -> IO () printPretty = putStr . T.unpack . prettyprint |