From b3bb2e8a8543cc863cd83ba7cfa1a7d36d4c7099 Mon Sep 17 00:00:00 2001
From: stuebinm <stuebinm@disroot.org>
Date: Thu, 30 Sep 2021 15:51:53 +0200
Subject: [PATCH] remove unused Maybe

---
 lib/CheckMap.hs | 8 ++++----
 1 file 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)
-- 
GitLab