1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Remove TODO and leave readFile behavior alone for now

This commit is contained in:
Timothy Clem 2017-04-25 09:07:51 -07:00
parent 6be9b9c3cd
commit 975304097c

View File

@ -14,9 +14,6 @@ import qualified Data.Text.ICU.Detect as Detect
-- | Read a file to a SourceBlob, transcoding to UTF-8 along the way.
readFile :: FilePath -> IO SourceBlob
readFile path = do
-- source <- readFile' path
-- pure $ sourceBlob source path
-- TODO: Do we want to swallow IOExceptions for files that don't exist? I'm not sure this is a good idea.
source <- (Just <$> readFile' path) `catch` (const (pure Nothing) :: IOException -> IO (Maybe Source))
pure $ fromMaybe (emptySourceBlob path) (flip sourceBlob path <$> source)
where