aoc2018-0.1.0.0: Advent of Code 2018 solutions and auto-runner

Copyright(c) Justin Le 2018
LicenseBSD3
Maintainerjustin@jle.im
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

AOC.Challenge

Description

Gather together all challenges and collect them into a single map.

Synopsis

Documentation

type ChallengeMap = Map (Finite 25) (Map Part SomeSolution) Source #

A map of days to parts to solutions.

data ChallengeSpec Source #

A specification for a specific challenge. Should consist of a day and a lowercase character.

Constructors

CS 

Fields

data Part #

A given part of a problem. All Advent of Code challenges are two-parts.

You can usually get Part1 (if it is already released) with a nonsense session key, but Part2 always requires a valid session key.

Note also that Challenge #25 typically only has a single part.

Constructors

Part1 
Part2 
Instances
Bounded Part 
Instance details

Defined in Advent

Enum Part 
Instance details

Defined in Advent

Methods

succ :: Part -> Part #

pred :: Part -> Part #

toEnum :: Int -> Part #

fromEnum :: Part -> Int #

enumFrom :: Part -> [Part] #

enumFromThen :: Part -> Part -> [Part] #

enumFromTo :: Part -> Part -> [Part] #

enumFromThenTo :: Part -> Part -> Part -> [Part] #

Eq Part 
Instance details

Defined in Advent

Methods

(==) :: Part -> Part -> Bool #

(/=) :: Part -> Part -> Bool #

Ord Part 
Instance details

Defined in Advent

Methods

compare :: Part -> Part -> Ordering #

(<) :: Part -> Part -> Bool #

(<=) :: Part -> Part -> Bool #

(>) :: Part -> Part -> Bool #

(>=) :: Part -> Part -> Bool #

max :: Part -> Part -> Part #

min :: Part -> Part -> Part #

Read Part 
Instance details

Defined in Advent

Show Part 
Instance details

Defined in Advent

Methods

showsPrec :: Int -> Part -> ShowS #

show :: Part -> String #

showList :: [Part] -> ShowS #

Generic Part 
Instance details

Defined in Advent

Associated Types

type Rep Part :: Type -> Type #

Methods

from :: Part -> Rep Part x #

to :: Rep Part x -> Part #

type Rep Part 
Instance details

Defined in Advent

type Rep Part = D1 (MetaData "Part" "Advent" "advent-of-code-api-0.1.2.3-LLIu8UQukuU8y7moMLlYNI" False) (C1 (MetaCons "Part1" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Part2" PrefixI False) (U1 :: Type -> Type))

challengeMap :: ChallengeMap Source #

A map of all challenges.

lookupSolution :: ChallengeSpec -> Map (Finite 25) (Map Part a) -> Maybe a Source #

Lookup up a solution from a ChallengeMap

dayToInt :: Finite 25 -> Int Source #

Turn a day represented by a Finite 25 into an integer day (1 - 25).

solSpec :: Name -> ChallengeSpec Source #

Get a ChallengeSpec from a given reified solution (name).

solSpec 'day02a == CS { _csDay = 1, _csPart = a }

charPart :: Char -> Maybe Part Source #

Parse a Literal into a Part