tickle 0.0.5 → 0.0.6
raw patch · 3 files changed
+18/−4 lines, 3 filesdep ~filepath
Dependency ranges changed: filepath
Files
- changelog +5/−0
- src/Data/Tickle/Get.hs +11/−3
- tickle.cabal +2/−1
changelog view
@@ -1,3 +1,8 @@+0.0.6++* Change `inlinePerformIO` to `unsafePerformIO`.+* add `runGetFile`.+ 0.0.5 * Remove {-# LANGUAGE Safe #-} because validation-0.5.2 removed Safe.
src/Data/Tickle/Get.hs view
@@ -101,6 +101,7 @@ , _Done -- ** Run Get parser , runGet+, runGetFile , (.>>) , (<<.) , runGetIncremental@@ -146,8 +147,7 @@ import Data.Bits((.|.), (.&.), shiftL, shiftR) import Data.Bool(Bool(False, True), (&&), not, otherwise) import qualified Data.ByteString as B(ByteString, concat, append, length, splitAt, empty, null, break, drop)-import qualified Data.ByteString.Internal as BI-import qualified Data.ByteString.Lazy as L(ByteString, toChunks, fromChunks)+import qualified Data.ByteString.Lazy as L(ByteString, toChunks, fromChunks, readFile) import qualified Data.ByteString.Lazy.Internal as LI(ByteString(Chunk, Empty)) import qualified Data.ByteString.Unsafe as BU(unsafeDrop, unsafeTake, unsafeHead, unsafeIndex, unsafeUseAsCString) import Data.Either(Either(Left, Right), either)@@ -170,6 +170,7 @@ import Data.Traversable(Traversable(traverse)) import Data.Tuple(uncurry) import Foreign(Ptr, castPtr, Storable(peek), sizeOf, alloca, poke)+import System.FilePath(FilePath) import System.IO.Unsafe(unsafePerformIO) #if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__) import GHC.Word(Word, Word8, Word16(W16#), Word32(W32#), Word64(W64#))@@ -1207,7 +1208,7 @@ -> (Ptr a -> IO a) -> Get () a readNWith n f =- readN n (\s -> BI.inlinePerformIO (BU.unsafeUseAsCString s (f . castPtr)))+ readN n (\s -> unsafePerformIO (BU.unsafeUseAsCString s (f . castPtr))) {-# INLINE readNWith #-} data Decoder e a =@@ -1422,6 +1423,13 @@ _RunGetFail # (p, e) in feedAll (runGetIncremental g) b +runGetFile ::+ Get e a+ -> FilePath+ -> IO (RunGetResult e a)+runGetFile g =+ fmap (runGet g) . L.readFile+ pushChunk :: Decoder e a -> B.ByteString
tickle.cabal view
@@ -1,5 +1,5 @@ name: tickle-version: 0.0.5+version: 0.0.6 license: BSD3 license-file: LICENSE author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>@@ -38,6 +38,7 @@ , transformers >= 0.3.0.0 , mtl >= 2.1 , validation >= 0.3.4+ , filepath >= 1.4 ghc-options: -Wall