markVisited :: Map.Map Int Int -> Grid -> Grid
markVisited visited (Grid dims sqs) =
  let
   sqs' = Unboxed.imap (\ i x -> if Map.member i visited then 4 else x) sqs
  in
    (Grid dims sqs')
markVisited :: Map.Map Int Int -> Grid -> Grid
markVisited visited (Grid dims sqs) =
  let
   sqs' = Unboxed.imap (\ i x -> if Map.member i visited then 4 else x) sqs
  in
    (Grid dims sqs')
markVisited visited (Grid dims sqs) =
  let
   sqs' = Unboxed.imap (\ i x -> if Map.member i visited then 4 else x) sqs
  in
    (Grid dims sqs')