From: Neil Smith Date: Sun, 24 Dec 2017 14:43:03 +0000 (+0000) Subject: Tidying X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=f12a6a3138c30e2a034daef9d75567694f7213b5;p=advent-of-code-17.git Tidying --- diff --git a/src/advent24/advent24.hs b/src/advent24/advent24.hs index df3136b..f048c65 100644 --- a/src/advent24/advent24.hs +++ b/src/advent24/advent24.hs @@ -70,7 +70,7 @@ extendOneBridge parts bridge = grow :: Bridge -> Part -> Bridge grow bridge part = bridge {bridgeParts = bp', requiring = req'} where req = requiring bridge - req' = B.findMin $ B.delete req part + req' = B.findMin $ B.delete req part -- can get away with `findMin` as I know there are only two elements in a `Part` bp' = B.insert part $ bridgeParts bridge candidates :: Parts -> Bridge -> Candidates @@ -104,11 +104,11 @@ integer = lexeme L.integer symbol = L.symbol sc slash = symbol "/" -partsP = partP `sepBy` newline +partsP = B.fromList <$> partP `sepBy` newline partP = B.fromList <$> integer `sepBy` slash successfulParse :: Text -> Parts successfulParse input = case parse partsP "input" input of - Left _error -> B.empty -- TIO.putStr $ T.pack $ parseErrorPretty err - Right partsList -> B.fromList partsList \ No newline at end of file + Left _error -> B.empty + Right partsList -> partsList \ No newline at end of file