{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-dodgy-exports #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
module AOC.Challenge (
module AOC
, ChallengeMap
, ChallengeSpec(..), Part(..)
, challengeMap
, lookupSolution
, Day(..), dayInt, mkDay, mkDay_
, solSpec
, charPart
) where
import AOC.Challenge.Day01 as AOC
import AOC.Challenge.Day02 as AOC
import AOC.Challenge.Day03 as AOC
import AOC.Challenge.Day04 as AOC
import AOC.Challenge.Day05 as AOC
import AOC.Challenge.Day06 as AOC
import AOC.Challenge.Day07 as AOC
import AOC.Challenge.Day08 as AOC
import AOC.Challenge.Day09 as AOC
import AOC.Challenge.Day10 as AOC
import AOC.Challenge.Day11 as AOC
import AOC.Challenge.Day12 as AOC
import AOC.Challenge.Day13 as AOC
import AOC.Challenge.Day14 as AOC
import AOC.Challenge.Day15 as AOC
import AOC.Challenge.Day16 as AOC
import AOC.Challenge.Day17 as AOC
import AOC.Challenge.Day18 as AOC
import AOC.Challenge.Day19 as AOC
import AOC.Challenge.Day20 as AOC
import AOC.Challenge.Day21 as AOC
import AOC.Challenge.Day22 as AOC
import AOC.Challenge.Day23 as AOC
import AOC.Challenge.Day24 as AOC
import AOC.Challenge.Day25 as AOC
import AOC.Discover
import AOC.Solver
import Advent
import Control.Monad
import Data.Finite
import Data.Map (Map)
import qualified Data.Map as M
challengeMap :: ChallengeMap
challengeMap :: ChallengeMap
challengeMap = [(Day, (Part, SomeSolution))] -> ChallengeMap
mkChallengeMap $$(solutionList "src/AOC/Challenge")
lookupSolution :: ChallengeSpec -> Map Day (Map Part a) -> Maybe a
lookupSolution :: forall a. ChallengeSpec -> Map Day (Map Part a) -> Maybe a
lookupSolution CS{Day
Part
_csPart :: ChallengeSpec -> Part
_csDay :: ChallengeSpec -> Day
_csPart :: Part
_csDay :: Day
..} = Part -> Map Part a -> Maybe a
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Part
_csPart (Map Part a -> Maybe a)
-> (Map Day (Map Part a) -> Maybe (Map Part a))
-> Map Day (Map Part a)
-> Maybe a
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Day -> Map Day (Map Part a) -> Maybe (Map Part a)
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Day
_csDay