diff options
Diffstat (limited to 'tiled/Data/Tiled.hs')
-rw-r--r-- | tiled/Data/Tiled.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tiled/Data/Tiled.hs b/tiled/Data/Tiled.hs index 8a8036e..d3ccb26 100644 --- a/tiled/Data/Tiled.hs +++ b/tiled/Data/Tiled.hs @@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} @@ -19,10 +20,10 @@ module Data.Tiled where import Universum -import Data.Aeson hiding (Object) -import qualified Data.Aeson as A -import Data.Aeson.Types (typeMismatch) -import Data.Char (toLower) +import Data.Aeson hiding (Object) +import qualified Data.Aeson as A +import Data.Aeson.Types (typeMismatch) +import Data.Char (toLower) -- | options for Aeson's generic encoding and parsing functions @@ -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 |