Skip to content
Snippets Groups Projects
Unverified Commit b3bb2e8a authored by stuebinm's avatar stuebinm
Browse files

remove unused Maybe

parent e68d6523
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment