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

Description

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

Synopsis

Documentation

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

Meant to be called like:

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

solutionList :: FilePath -> Code Q [(Day, (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 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

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 Char into a Part

solverNFData :: Name -> Q Bool Source #

Check if a solver identifier is of type A :~> B, where B is an instance of NFData.

deepInstance Source #

Arguments

:: Name

class

-> Type

type

-> Q Bool 

Check if a type is an instance of a class, unifying when possible