@@ -46,7 +46,6 @@ module Text.Pandoc.Free ( PandocActionF(..)
4646 , newStdGen
4747 , newUniqueHash
4848 , readFileLazy
49− , readFileUTF8
5049 , readDataFile
5150 , fetchItem
5251 , fetchItem'
@@ -79,7 +78,6 @@ import qualified Data.ByteString.Lazy as BL
7978import Control.Monad.Free
8079import qualified Control.Exception as E
8180import qualified System.Environment as IO (lookupEnv)
82−import qualified Text.Pandoc.UTF8 as UTF8 (readFile, toString)
8381import System.FilePath.Glob (match, compile)
8482import System.FilePath ((</>))
8583import qualified System.FilePath.Glob as IO (glob)
@@ -97,7 +95,6 @@ data PandocActionF nxt =
9795 | NewStdGen (StdGen -> nxt)
9896 | NewUniqueHash (Int -> nxt)
9997 | ReadFileLazy FilePath (BL.ByteString -> nxt)
100− | ReadFileUTF8 FilePath (String -> nxt)
10198 | ReadDataFile (Maybe FilePath) FilePath (B.ByteString -> nxt)
10299 | FetchItem (Maybe String) (String)
103100 (Either E.SomeException (B.ByteString, Maybe MimeType) -> nxt)
@@ -134,9 +131,6 @@ newUniqueHash = liftF $ NewUniqueHash id
134131readFileLazy :: FilePath -> PandocAction BL.ByteString
135132readFileLazy fp = liftF $ ReadFileLazy fp id
136133
137−readFileUTF8 :: FilePath -> PandocAction String
138−readFileUTF8 fp = liftF $ ReadFileUTF8 fp id
139−
140134readDataFile :: Maybe FilePath -> FilePath -> PandocAction B.ByteString
141135readDataFile mfp fp = liftF $ ReadDataFile mfp fp id
142136
@@ -172,7 +166,6 @@ runIO (Free (GetDefaultReferenceODT mfp f)) =
172166runIO (Free (NewStdGen f)) = IO.newStdGen >>= runIO . f
173167runIO (Free (NewUniqueHash f)) = hashUnique <$> IO.newUnique >>= runIO . f
174168runIO (Free (ReadFileLazy fp f)) = BL.readFile fp >>= runIO . f
175−runIO (Free (ReadFileUTF8 fp f)) = UTF8.readFile fp >>= runIO . f
176169runIO (Free (ReadDataFile mfp fp f)) = IO.readDataFile mfp fp >>= runIO . f
177170runIO (Free (Fail s)) = M.fail s
178171runIO (Free (FetchItem sourceUrl nm f)) =
@@ -241,11 +234,6 @@ runTest (Free (ReadFileLazy fp f)) = do
241234 case lookup fp fps of
242235 Just bs -> return (BL.fromStrict bs) >>= runTest . f
243236 Nothing -> error "openFile: does not exist"
244−runTest (Free (ReadFileUTF8 fp f)) = do
245− fps <- asks envFiles
246− case lookup fp fps of
247− Just bs -> return (UTF8.toString bs) >>= runTest . f
248− Nothing -> error "openFile: does not exist"
249237-- A few different cases of readDataFile to reimplement, for when
250238-- there is no filepath and it falls through to readDefaultDataFile
251239runTest (Free (ReadDataFile Nothing "reference.docx" f)) = do