From: Neil Smith Date: Fri, 22 Dec 2017 11:25:13 +0000 (+0000) Subject: More todying X-Git-Url: https://git.njae.me.uk/?p=advent-of-code-17.git;a=commitdiff_plain;h=0c7f1b478186169e9ef06ceb669a0c5f489a4849 More todying --- diff --git a/src/advent21/advent21.hs b/src/advent21/advent21.hs index a4a092b..fcc28d3 100644 --- a/src/advent21/advent21.hs +++ b/src/advent21/advent21.hs @@ -12,10 +12,8 @@ import Text.Megaparsec hiding (State) import qualified Text.Megaparsec.Lexer as L import Text.Megaparsec.Text (Parser) import qualified Control.Applicative as CA --- import qualified Data.Functor as F import qualified Data.Map.Strict as M -import Data.Map.Strict ((!)) import Data.List @@ -106,7 +104,7 @@ explodeGrid :: Grid -> ExplodedGrid explodeGrid g = if (rm + 1) `rem` 2 == 0 then explodeGrid' 2 g else explodeGrid' 3 g - where (rm, cm) = bounds g + where (rm, _cm) = bounds g explodeGrid' :: Int -> Grid -> ExplodedGrid explodeGrid' n g = M.fromList [((bigR, bigC), subGrid n g bigR bigC) | bigR <- [0..bigRm], bigC <- [0..bigCm]] @@ -167,8 +165,6 @@ onlySpace = (char ' ') <|> (char '\t') sc :: Parser () sc = L.space (skipSome onlySpace) CA.empty CA.empty -lexeme = L.lexeme sc - symbol = L.symbol sc rowSep = symbol "/" ruleJoin = symbol "=>" diff --git a/src/advent21/advent21parallel.hs b/src/advent21/advent21parallel.hs index cd0b898..3ec87ff 100644 --- a/src/advent21/advent21parallel.hs +++ b/src/advent21/advent21parallel.hs @@ -12,10 +12,8 @@ import Text.Megaparsec hiding (State) import qualified Text.Megaparsec.Lexer as L import Text.Megaparsec.Text (Parser) import qualified Control.Applicative as CA --- import qualified Data.Functor as F import qualified Data.Map.Strict as M -import Data.Map.Strict ((!)) import Data.List @@ -110,7 +108,7 @@ explodeGrid :: Grid -> ExplodedGrid explodeGrid g = if (rm + 1) `rem` 2 == 0 then explodeGrid' 2 g else explodeGrid' 3 g - where (rm, cm) = bounds g + where (rm, _cm) = bounds g explodeGrid' :: Int -> Grid -> ExplodedGrid explodeGrid' n g = M.fromList [((bigR, bigC), subGrid n g bigR bigC) | bigR <- [0..bigRm], bigC <- [0..bigCm]] @@ -172,8 +170,6 @@ onlySpace = (char ' ') <|> (char '\t') sc :: Parser () sc = L.space (skipSome onlySpace) CA.empty CA.empty -lexeme = L.lexeme sc - symbol = L.symbol sc rowSep = symbol "/" ruleJoin = symbol "=>"