git.iko.soy/typeable/pandoc
on master help sign in
Removed unneeded CPP conditional.

Removed code that was conditional on base < 4.2, since now we require base >= 4.2.

commit31107741f0ee69d444e5f9ed2d8272583024e10c authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 23 Sep 2012, 21:43 (14 years ago) parent3e302bf
1 file changed−44
src/Text/Pandoc/UTF8.hs−44
src/Text/Pandoc/UTF8.hs−44
@@ -46,8 +46,6 @@ where
4646import Codec.Binary.UTF8.String (encodeString, decodeString)
4747#endif
4848
49−#if MIN_VERSION_base(4,2,0)
50−
5149import System.IO hiding (readFile, writeFile, getContents,
5250 putStr, putStrLn, hPutStr, hPutStrLn, hGetContents)
5351import Prelude hiding (readFile, writeFile, getContents, putStr, putStrLn )
@@ -79,48 +77,6 @@ hPutStrLn h s = hSetEncoding h utf8 >> IO.hPutStrLn h s
7977hGetContents :: Handle -> IO String
8078hGetContents h = hSetEncoding h utf8_bom >> IO.hGetContents h
8179
82−#else
83−
84−import qualified Data.ByteString as B
85−import Data.ByteString.UTF8 (toString, fromString)
86−import Prelude hiding (readFile, writeFile, getContents, putStr, putStrLn)
87−import System.IO (Handle)
88−import Control.Monad (liftM)
89−
90−
91−bom :: B.ByteString
92−bom = B.pack [0xEF, 0xBB, 0xBF]
93−
94−stripBOM :: B.ByteString -> B.ByteString
95−stripBOM s | bom `B.isPrefixOf` s = B.drop 3 s
96−stripBOM s = s
97−
98−readFile :: FilePath -> IO String
99−readFile = liftM (toString . stripBOM) . B.readFile . encodePath
100−
101−writeFile :: FilePath -> String -> IO ()
102−writeFile f = B.writeFile (encodePath f) . fromString
103−
104−getContents :: IO String
105−getContents = liftM (toString . stripBOM) B.getContents
106−
107−hGetContents :: Handle -> IO String
108−hGetContents h = liftM (toString . stripBOM) (B.hGetContents h)
109−
110−putStr :: String -> IO ()
111−putStr = B.putStr . fromString
112−
113−putStrLn :: String -> IO ()
114−putStrLn = B.putStrLn . fromString
115−
116−hPutStr :: Handle -> String -> IO ()
117−hPutStr h = B.hPutStr h . fromString
118−
119−hPutStrLn :: Handle -> String -> IO ()
120−hPutStrLn h s = hPutStr h (s ++ "\n")
121−
122−#endif
123−
12480encodePath :: FilePath -> FilePath
12581decodeArg :: String -> String
12682#if MIN_VERSION_base(4,4,0)