We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 913ca87 commit 27a7ccbCopy full SHA for 27a7ccb
IncludeFilter.hs
@@ -73,12 +73,9 @@ stripPandoc p =
73
Right (Pandoc _ blocks) -> blocks
74
75
fileContentAsString :: String -> IO String
76
-fileContentAsString file = do
77
- let handle = openFile file ReadMode
78
- fmap (`hSetEncoding` utf8) handle
79
- !contents <- fmap hGetContents handle
80
- fmap hClose handle
81
- contents
+fileContentAsString file = withFile file ReadMode $ \handle -> do
+ hSetEncoding handle utf8
+ hGetContents handle
82
83
fileContentAsBlocks :: String -> IO [Block]
84
fileContentAsBlocks file = do
0 commit comments