[hs] Solve 2020_03

This commit is contained in:
Joscha 2020-12-03 11:49:24 +00:00
parent 7183f49a6b
commit 23636d3fc0
4 changed files with 56 additions and 6 deletions

View file

@ -1,5 +1,6 @@
module Aoc.Day
( Day(..)
, runDay
, dayPure
, dayFile
, dayString
@ -19,6 +20,11 @@ data Day
= DayPure String (IO ())
| DayFile String (FilePath -> IO ())
-- | Helper function for trying out days in ghci.
runDay :: Day -> FilePath -> IO ()
runDay (DayPure _ f) _ = f
runDay (DayFile _ f) p = f p
dayPure :: String -> IO () -> Day
dayPure = DayPure