| Copyright | (c) Justin Le 2018 | 
|---|---|
| License | BSD3 | 
| Maintainer | justin@jle.im | 
| Stability | experimental | 
| Portability | non-portable | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
AOC.Run.Load
Contents
Description
Loading challenge data and prompts.
Synopsis
- data ChallengePaths = CP {}
- challengePaths :: Integer -> ChallengeSpec -> ChallengePaths
- data ChallengeData = CD {}
- challengeData :: Maybe String -> Integer -> ChallengeSpec -> IO ChallengeData
- newtype Day = Day {}
- countdownConsole :: MonadIO m => Integer -> Day -> m a -> m a
- countdownWithPrint :: MonadIO m => m NominalDiffTime -> Int -> String -> m a -> m a
- timeToRelease :: Integer -> Day -> IO NominalDiffTime
- showNominalDiffTime :: NominalDiffTime -> String
- charPart :: Char -> Maybe Part
- showAoCError :: AoCError -> [String]
- htmlToMarkdown :: Bool -> Text -> Either [String] Text
- mkDay :: Integer -> Maybe Day
- mkDay_ :: Integer -> Day
- dayInt :: Day -> Integer
- data TestMeta = TM {}
- parseMeta :: Parser TestMeta
- parseTests :: Parser [(String, TestMeta)]
Documentation
data ChallengePaths Source #
A record of paths corresponding to a specific challenge.
Constructors
| CP | |
Instances
| Show ChallengePaths Source # | |
| Defined in AOC.Run.Load Methods showsPrec :: Int -> ChallengePaths -> ShowS # show :: ChallengePaths -> String # showList :: [ChallengePaths] -> ShowS # | |
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.
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).
Instances
| Bounded Day | |
| Enum Day | |
| Eq Day | |
| Ord Day | |
| Show Day | |
| Generic Day | |
| FromJSON Day | |
| Defined in Advent.Types | |
| ToJSON Day | |
| Defined in Advent.Types | |
| FromJSONKey Day | |
| Defined in Advent.Types | |
| ToJSONKey Day | |
| Defined in Advent.Types | |
| ToHttpApiData Day | |
| Defined in Advent.Types Methods toUrlPiece :: Day -> Text toEncodedUrlPiece :: Day -> Builder toHeader :: Day -> ByteString toQueryParam :: Day -> Text | |
| type Rep Day | |
| Defined in Advent.Types | |
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.
countdownWithPrint :: MonadIO m => m NominalDiffTime -> Int -> String -> m a -> m a Source #
timeToRelease :: Integer -> Day -> IO NominalDiffTime #
showNominalDiffTime :: NominalDiffTime -> String Source #
Pretty-print a NominalDiffTime
showAoCError :: AoCError -> [String] Source #
Parsers
parseTests :: Parser [(String, TestMeta)] Source #