advent-0.1.0.0: Advent of Code common library
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Advent.Input

Description

This module provides input files in some of the most commonly needed formats. It either automatically loads from an inputs directory, or takes the input file as a command-line argument.

Synopsis

Documentation

getRawInput Source #

Arguments

:: Int

year

-> Int

day number

-> IO String 

Get the input for the given day.

If a filename is provided in the command line that will be used as the input file.

If the filename is - the stdin will be used as the input file.

Otherwise the input text file corresponding to the day number will be used.

inputFileName Source #

Arguments

:: Int

day

-> FilePath 

Default input filename given a day number

getInputLines Source #

Arguments

:: Int

year

-> Int

day

-> IO [String] 

Load input file as a list of lines.

getInputArray Source #

Arguments

:: Int

year

-> Int

day

-> IO (UArray Coord Char) 

Load input file as a rectangular array of characters.

getInputMap Source #

Arguments

:: Int

year

-> Int

day

-> IO (Map Coord Char) 

Load input file as a 2-dimensional map of characters.