+mapMazeSection :: [Coord] -> MazeSection -> Mapper
+mapMazeSection !starts (Junction mazes) =
+ concatMapM (\maze -> mapMaze starts maze) mazes
+mapMazeSection !starts (Path steps) =
+ mapM mapPath starts
+ where mapPath start = foldM (\here step -> includeDoor here step) start steps
+
+includeDoor :: Coord -> Coord -> State Doors Coord
+includeDoor !here !step =
+ do let there = (here + step)
+ let door = there `seq` makeDoor here there
+ modify' (door `seq` S.insert door)
+ return there
+
+
+type Parser = Parsec Void Text