summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorstuebinm2021-10-30 15:23:29 +0200
committerstuebinm2021-10-30 15:44:26 +0200
commit1d2733c2b960e4ec61981a2cf2aadb77004b429d (patch)
tree5d967566168d0bf4501d1001a3d5bcd7a61aead6 /lib
parent69484ee8d2114150b81109067428110e9a18c475 (diff)
turns out records are just sugar
(and one that contains almost only mempty can be written much shorter than I thought it could)
Diffstat (limited to 'lib')
-rw-r--r--lib/CheckMap.hs10
1 files changed, 2 insertions, 8 deletions
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)