readHintFile :: FilePath -> (String, [String]) -> IO [Hint]
readHintFile dir (file,allowed) =
    do ex <- doesFileExist (dir </> file)
       if ex
         then do
            h <- openFile (dir </> file) ReadMode
            hSetEncoding h char8
            concatMap (readHintLine allowed) . untilFinished . lines <$> hGetContents h
         else return []
readHintFile :: FilePath -> (String, [String]) -> IO [Hint]
readHintFile dir (file,allowed) =
    do ex <- doesFileExist (dir </> file)
       if ex
         then do
            h <- openFile (dir </> file) ReadMode
            hSetEncoding h char8
            concatMap (readHintLine allowed) . untilFinished . lines <$> hGetContents h
         else return []
readHintFile dir (file,allowed) =
    do ex <- doesFileExist (dir </> file)
       if ex
         then do
            h <- openFile (dir </> file) ReadMode
            hSetEncoding h char8
            concatMap (readHintLine allowed) . untilFinished . lines <$> hGetContents h
         else return []