aoc2019-0.1.0.0: Development environment for Advent of Code challenges

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 Day (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.

Constructors

Part1 
Part2 
Instances
Bounded Part 
Instance details

Defined in Advent.Types

Enum Part 
Instance details

Defined in Advent.Types

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.Types

Methods

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

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

Ord Part 
Instance details

Defined in Advent.Types

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.Types

Show Part 
Instance details

Defined in Advent.Types

Methods

showsPrec :: Int -> Part -> ShowS #

show :: Part -> String #

showList :: [Part] -> ShowS #

Generic Part 
Instance details

Defined in Advent.Types

Associated Types

type Rep Part :: Type -> Type #

Methods

from :: Part -> Rep Part x #

to :: Rep Part x -> Part #

ToJSON Part

Since: advent-of-code-api-0.2.4.2

Instance details

Defined in Advent.Types

ToJSONKey Part

Since: advent-of-code-api-0.2.4.2

Instance details

Defined in Advent.Types

FromJSON Part 
Instance details

Defined in Advent.Types

FromJSONKey Part 
Instance details

Defined in Advent.Types

ToHttpApiData Part 
Instance details

Defined in Advent.Types

type Rep Part 
Instance details

Defined in Advent.Types

type Rep Part = D1 (MetaData "Part" "Advent.Types" "advent-of-code-api-0.2.7.0-A5oxcsofFVHg0A28OTKUb" 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 Day (Map Part a) -> Maybe a Source #

Lookup up a solution from a ChallengeMap

newtype Day #

Describes the day: a number between 1 and 25 inclusive.

Represented by a Finite ranging from 0 to 24 inclusive; you should probably make one using the smart constructor mkDay.

Constructors

Day 

Fields

Instances
Bounded Day 
Instance details

Defined in Advent.Types

Methods

minBound :: Day #

maxBound :: Day #

Enum Day 
Instance details

Defined in Advent.Types

Methods

succ :: Day -> Day #

pred :: Day -> Day #

toEnum :: Int -> Day #

fromEnum :: Day -> Int #

enumFrom :: Day -> [Day] #

enumFromThen :: Day -> Day -> [Day] #

enumFromTo :: Day -> Day -> [Day] #

enumFromThenTo :: Day -> Day -> Day -> [Day] #

Eq Day 
Instance details

Defined in Advent.Types

Methods

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

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

Ord Day 
Instance details

Defined in Advent.Types

Methods

compare :: Day -> Day -> Ordering #

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

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

(>) :: Day -> Day -> Bool #

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

max :: Day -> Day -> Day #

min :: Day -> Day -> Day #

Show Day 
Instance details

Defined in Advent.Types

Methods

showsPrec :: Int -> Day -> ShowS #

show :: Day -> String #

showList :: [Day] -> ShowS #

Generic Day 
Instance details

Defined in Advent.Types

Associated Types

type Rep Day :: Type -> Type #

Methods

from :: Day -> Rep Day x #

to :: Rep Day x -> Day #

ToJSON Day

Since: advent-of-code-api-0.2.4.2

Instance details

Defined in Advent.Types

ToJSONKey Day

Since: advent-of-code-api-0.2.4.2

Instance details

Defined in Advent.Types

FromJSON Day 
Instance details

Defined in Advent.Types

FromJSONKey Day 
Instance details

Defined in Advent.Types

ToHttpApiData Day 
Instance details

Defined in Advent.Types

type Rep Day 
Instance details

Defined in Advent.Types

type Rep Day = D1 (MetaData "Day" "Advent.Types" "advent-of-code-api-0.2.7.0-A5oxcsofFVHg0A28OTKUb" True) (C1 (MetaCons "Day" PrefixI True) (S1 (MetaSel (Just "dayFinite") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Finite 25))))

dayInt :: Day -> Integer #

Convert a Finite 25 day into a day integer (1 - 25). Inverse of mkDay.

mkDay :: Integer -> Maybe Day #

Construct a Day from a day integer (1 - 25). If input is out of range, Nothing is returned. See mkDay_ for an unsafe version useful for literals.

Inverse of dayInt.

mkDay_ :: Integer -> Day #

Construct a Finite 25 (the type of a Day) from a day integer (1 - 25). Is undefined if input is out of range. Can be useful for compile-time literals, like mkDay_ 4

Inverse of dayInt.

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