Skip to content
Snippets Groups Projects
Commit ab16b947 authored by stuebinm's avatar stuebinm
Browse files

make tiled even more strict

turns out aeson really REALLY likes to keep huge scientific numbers
around, which is great if your data structures consist largely of arrays
of (small) integers!
parent 5d8cbd7c
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
......@@ -381,6 +382,6 @@ instance ToJSON Tiledmap where
-- | Load a Tiled map from the given 'FilePath'.
loadTiledmap :: FilePath -> IO (Either String Tiledmap)
loadTiledmap path = eitherDecodeFileStrict' path <&> \case
Left err -> Left err
Right tiledmap -> Right tiledmap
loadTiledmap path = eitherDecodeFileStrict' path >>= \case
Left err -> pure $ Left err
Right !tiledmap -> evaluateNF tiledmap <&> Right
......@@ -4,11 +4,10 @@ module Data.Tiled.Abstract where
import Universum
import qualified Data.Vector as V
import Data.Tiled (GlobalId, Layer (..), Object (..), Property (..),
import Data.Tiled (Layer (..), Object (..), Property (..),
PropertyValue (..), Tile (..), Tiledmap (..),
Tileset (..), mkTiledId)
import Util (showText)
Tileset (..), GlobalId)
import qualified Data.Vector as V
class HasProperties a where
getProperties :: a -> [Property]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment