diff options
Diffstat (limited to '')
-rw-r--r-- | lib/Util.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Util.hs b/lib/Util.hs index 42ba960..82d326f 100644 --- a/lib/Util.hs +++ b/lib/Util.hs @@ -9,6 +9,7 @@ module Util where import Data.Aeson as Aeson import Data.Text (Text) import qualified Data.Text as T +import Tiled2 (PropertyValue(..)) -- | haskell's many string types are FUN … showText :: Show a => a -> Text @@ -29,6 +30,11 @@ instance PrettyPrint Aeson.Value where Aeson.String s -> prettyprint s v -> (T.pack . show) v +instance PrettyPrint PropertyValue where + prettyprint = \case + StrProp str -> str + BoolProp bool -> if bool then "true" else "false" + -- | here since Unit is sometimes used as dummy type instance PrettyPrint () where prettyprint _ = error "shouldn't pretty-print Unit" |