From 1d2733c2b960e4ec61981a2cf2aadb77004b429d Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 30 Oct 2021 15:23:29 +0200 Subject: turns out records are just sugar (and one that contains almost only mempty can be written much shorter than I thought it could) --- lib/CheckMap.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/CheckMap.hs') diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index 3047071..845513d 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -39,9 +39,9 @@ import Util (PrettyPrint (prettyprint), prettyprint) data MapResult = MapResult { mapresultLayer :: Map Hint [Layer] , mapresultTileset :: Map Hint [Tileset] --Map Text (LintResult Tileset) - , mapresultGeneral :: [Lint] , mapresultDepends :: [Dep] , mapresultProvides :: [Text] + , mapresultGeneral :: [Lint] } deriving (Generic) instance ToJSON MapResult where @@ -67,16 +67,10 @@ instance ToJSON CollectedLints where -- layers upwards in the file hierarchy loadAndLintMap :: FilePath -> Int -> IO (Maybe MapResult) loadAndLintMap path depth = loadTiledmap path >>= pure . \case - DecodeErr err -> Just $ MapResult - { mapresultLayer = mempty - , mapresultTileset = mempty - , mapresultDepends = [] - , mapresultProvides = [] - , mapresultGeneral = + DecodeErr err -> Just $ MapResult mempty mempty mempty mempty [ hint Fatal . T.pack $ path <> ": Fatal: " <> err ] - } IOErr _ -> Nothing Loaded waMap -> Just (runLinter waMap depth) -- cgit v1.2.3