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.Run.Load

Contents

Description

Loading challenge data and prompts.

Synopsis

Documentation

data ChallengePaths Source #

A record of paths corresponding to a specific challenge.

Constructors

CP 
Instances
Show ChallengePaths Source # 
Instance details

Defined in AOC.Run.Load

challengePaths :: Integer -> ChallengeSpec -> ChallengePaths Source #

Generate a ChallengePaths from a specification of a challenge.

data ChallengeData Source #

A record of data (test inputs, answers) corresponding to a specific challenge.

Constructors

CD 

challengeData Source #

Arguments

:: Maybe String

session key

-> Integer

year

-> ChallengeSpec 
-> IO ChallengeData 

Load data associated with a challenge from a given specification. Will fetch answers online and cache if required (and if giten a session token).

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))))

countdownConsole Source #

Arguments

:: MonadIO m 
=> Integer

year of challenge

-> Day

day to count down to

-> m a

callback on release

-> m a 

Run a countdown on the console.

timeToRelease #

Arguments

:: Integer

year

-> Day

day

-> IO NominalDiffTime 

Get time until release of a given challenge.

charPart :: Char -> Maybe Part Source #

Parse a Literal into a Part

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.

dayInt :: Day -> Integer #

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

data TestMeta Source #

Constructors

TM 
Instances
Show TestMeta Source # 
Instance details

Defined in AOC.Run.Load

Parsers