Permalink
Browse files

Remove usage of deprecated bytestring functions

Add -XSafe extension (with supporting GHC versions)
  • Loading branch information...
1 parent 2a1f613 commit 6a094deb5bbcae615af0b1568eca88aff80bb136 @JohnLato JohnLato committed Sep 5, 2011
Showing with 9 additions and 5 deletions.
  1. +3 −1 ListLike.cabal
  2. +6 −4 src/Data/ListLike/Instances.hs
View
@@ -1,5 +1,5 @@
Name: ListLike
-Version: 3.1.2
+Version: 3.1.3
License: BSD3
Maintainer: John Lato <jwlato@gmail.com>
Author: John Goerzen
@@ -25,6 +25,8 @@ Stability: Stable
Library
Hs-Source-Dirs: src
+ if impl(ghc>=7.2.1)
+ Extensions: Safe
Exposed-Modules: Data.ListLike,
Data.ListLike.Base,
Data.ListLike.CharString,
@@ -47,11 +47,13 @@ import Data.ListLike.FoldableLL
import Data.Int
import Data.Monoid
import qualified Data.ByteString as BS
+import qualified Data.ByteString.Char8 as BSC
import qualified Data.Foldable as F
import qualified Data.Traversable as T
import qualified Data.Array.IArray as A
import Data.Array.IArray((!), (//), Ix(..))
import qualified Data.ByteString.Lazy as BSL
+import qualified Data.ByteString.Lazy.Char8 as BSLC
import qualified System.IO as IO
import Data.Word
@@ -176,11 +178,11 @@ instance ListLikeIO BS.ByteString Word8 where
hGet = BS.hGet
hGetNonBlocking = BS.hGetNonBlocking
hPutStr = BS.hPutStr
- hPutStrLn = BS.hPutStrLn
+ hPutStrLn = BSC.hPutStrLn
getLine = BS.getLine
getContents = BS.getContents
putStr = BS.putStr
- putStrLn = BS.putStrLn
+ putStrLn = BSC.putStrLn
interact = BS.interact
readFile = BS.readFile
writeFile = BS.writeFile
@@ -289,11 +291,11 @@ instance ListLikeIO BSL.ByteString Word8 where
hGet = BSL.hGet
hGetNonBlocking = BSL.hGetNonBlocking
hPutStr = BSL.hPut
- --hPutStrLn = BSL.hPutStrLn
+ -- hPutStrLn = BSLC.hPutStrLn
getLine = BS.getLine >>= strict2lazy
getContents = BSL.getContents
putStr = BSL.putStr
- putStrLn = BSL.putStrLn
+ putStrLn = BSLC.putStrLn
interact = BSL.interact
readFile = BSL.readFile
writeFile = BSL.writeFile

0 comments on commit 6a094de

Please sign in to comment.