summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorstuebinm2021-09-30 15:51:53 +0200
committerstuebinm2021-09-30 15:51:53 +0200
commitb3bb2e8a8543cc863cd83ba7cfa1a7d36d4c7099 (patch)
treee5c38dba30ea8a374c90a8d09815be2f8231a789 /lib
parente68d652323e454abf7e6c01ecedd919859cf9274 (diff)
remove unused Maybe
Diffstat (limited to 'lib')
-rw-r--r--lib/CheckMap.hs8
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)