advent2021-0.1.0.0: Advent of Code 2021 Solutions
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

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 :: Int -> IO [String] Source #

Load input file as a list of lines.

getInputArray :: Int -> IO (UArray Coord Char) Source #

Load input file as a rectangular array of characters.

getInputMap :: Int -> IO (Map Coord Char) Source #

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