Skip to content

Commit

Permalink
Renamed GameInfoItem -> CubeCount
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimitroulas committed Dec 3, 2023
1 parent 97a66ff commit 276192d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Solutions/Day02.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ strToColour "blue" = Blue
strToColour "green" = Green
strToColour _ = error "invalid colour"

type GameInfoItem = (Colour, Int)
type GameInfo = [GameInfoItem]
type CubeCount = (Colour, Int)
type GameInfo = [CubeCount]
type Game = (Int, [GameInfo])
type Input = [Game]

Expand All @@ -33,7 +33,7 @@ inputParser = linesOf $ do
gameInfo <- (cubeCountParser `P.sepBy` ", ") `P.sepBy` "; "
return (read gameId, gameInfo)

cubeCountParser :: Parser GameInfoItem
cubeCountParser :: Parser CubeCount
cubeCountParser = do
count <- P.many1 P.digit
P.space
Expand Down

0 comments on commit 276192d

Please sign in to comment.