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

Description

Template Haskell for discovering all named challenges in a given directory.

Synopsis

Documentation

mkChallengeMap :: [(Finite 25, (Part, SomeSolution))] -> ChallengeMap Source #

Meant to be called like:

mkChallengeMap $$(solutionList "src/AOC/Challenge")

solutionList :: FilePath -> Q (TExp [(Finite 25, (Part, SomeSolution))]) Source #

Template Haskell splice to produce a list of all named solutions in a directory. Expects solutions as function names following the format dayDDp, where DD is a two-digit zero-added day, and p is a lower-case letter corresponding to the part of the challenge.

See mkChallengeMap for a description of usage.

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

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