--- Writeup at https://work.njae.me.uk/2021/12/09/advent-of-code-2021-day-8/
-
+-- Writeup at https://work.njae.me.uk/2021/12/13/advent-of-code-2021-day-13/
import Data.Text ()
import qualified Data.Text.IO as TIO
data Fold = Fold Axis Int
deriving (Eq, Ord, Show)
-
-
main :: IO ()
main =
do text <- TIO.readFile "data/advent13.txt"
-- Parse the input file
-inputP = (,) <$> sheetP <* (many1 endOfLine) <*> foldsP
+inputP = (,) <$> sheetP <* many1 endOfLine <*> foldsP
-sheetP = S.fromList <$> (dotP `sepBy` endOfLine)
+sheetP = S.fromList <$> dotP `sepBy` endOfLine
dotP = V2 <$> decimal <* "," <*> decimal
foldsP = foldP `sepBy` endOfLine