diff options
-rw-r--r-- | lib/CheckMap.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index 49dcd2e..0bdfa35 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -33,7 +33,7 @@ import Util (PrettyPrint (prettyprint), prettyprint) -- | What this linter produces: lints for a single map data MapResult = MapResult - { mapresultLayer :: Maybe (Map Text (LintResult Layer)) + { mapresultLayer :: Map Text (LintResult Layer) , mapresultGeneral :: [Lint] , mapresultDepends :: [Dep] , mapresultProvides :: [Text] @@ -54,7 +54,7 @@ instance ToJSON MapResult where loadAndLintMap :: FilePath -> Int -> IO (Maybe MapResult) loadAndLintMap path depth = loadTiledmap path >>= pure . \case DecodeErr err -> Just $ MapResult - { mapresultLayer = Nothing + { mapresultLayer = mempty , mapresultDepends = [] , mapresultProvides = [] , mapresultGeneral = @@ -69,7 +69,7 @@ loadAndLintMap path depth = loadTiledmap path >>= pure . \case -- | lint a loaded map runLinter :: Tiledmap -> Int -> MapResult runLinter tiledmap depth = MapResult - { mapresultLayer = Just layerMap + { mapresultLayer = layerMap , mapresultGeneral = generalLints -- no general lints for now , mapresultDepends = concatMap (resultToDeps . snd) layer <> mapMaybe lintToDep generalLints @@ -102,7 +102,7 @@ instance PrettyPrint (Level, MapResult) where prettyLayer :: [Text] prettyLayer = mapMaybe (\(_,l) -> Just $ prettyprint (level, l)) - (maybe [] toList . mapresultLayer $ mapResult) + (toList . mapresultLayer $ mapResult) prettyGeneral :: [Text] prettyGeneral = map ((<> "\n") . prettyprint) |