aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-09-23 21:43:11 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-09-23 21:43:11 -0700
commit31107741f0ee69d444e5f9ed2d8272583024e10c (patch)
treeaa529ca369416e54782d8cd00b4a5c8f18a9034f /src/Text/Pandoc
parent3e302bf651776d78e923445104db30a459be2414 (diff)
downloadpandoc-31107741f0ee69d444e5f9ed2d8272583024e10c.tar.gz
Removed unneeded CPP conditional.
Removed code that was conditional on base < 4.2, since now we require base >= 4.2.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/UTF8.hs44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/Text/Pandoc/UTF8.hs b/src/Text/Pandoc/UTF8.hs
index 1d0eb4aee..aa3a9da04 100644
--- a/src/Text/Pandoc/UTF8.hs
+++ b/src/Text/Pandoc/UTF8.hs
@@ -46,8 +46,6 @@ where
import Codec.Binary.UTF8.String (encodeString, decodeString)
#endif
-#if MIN_VERSION_base(4,2,0)
-
import System.IO hiding (readFile, writeFile, getContents,
putStr, putStrLn, hPutStr, hPutStrLn, hGetContents)
import Prelude hiding (readFile, writeFile, getContents, putStr, putStrLn )
@@ -79,48 +77,6 @@ hPutStrLn h s = hSetEncoding h utf8 >> IO.hPutStrLn h s
hGetContents :: Handle -> IO String
hGetContents h = hSetEncoding h utf8_bom >> IO.hGetContents h
-#else
-
-import qualified Data.ByteString as B
-import Data.ByteString.UTF8 (toString, fromString)
-import Prelude hiding (readFile, writeFile, getContents, putStr, putStrLn)
-import System.IO (Handle)
-import Control.Monad (liftM)
-
-
-bom :: B.ByteString
-bom = B.pack [0xEF, 0xBB, 0xBF]
-
-stripBOM :: B.ByteString -> B.ByteString
-stripBOM s | bom `B.isPrefixOf` s = B.drop 3 s
-stripBOM s = s
-
-readFile :: FilePath -> IO String
-readFile = liftM (toString . stripBOM) . B.readFile . encodePath
-
-writeFile :: FilePath -> String -> IO ()
-writeFile f = B.writeFile (encodePath f) . fromString
-
-getContents :: IO String
-getContents = liftM (toString . stripBOM) B.getContents
-
-hGetContents :: Handle -> IO String
-hGetContents h = liftM (toString . stripBOM) (B.hGetContents h)
-
-putStr :: String -> IO ()
-putStr = B.putStr . fromString
-
-putStrLn :: String -> IO ()
-putStrLn = B.putStrLn . fromString
-
-hPutStr :: Handle -> String -> IO ()
-hPutStr h = B.hPutStr h . fromString
-
-hPutStrLn :: Handle -> String -> IO ()
-hPutStrLn h s = hPutStr h (s ++ "\n")
-
-#endif
-
encodePath :: FilePath -> FilePath
decodeArg :: String -> String
#if MIN_VERSION_base(4,4,0)