packages feed

chunked-data 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+13/−2 lines, 2 files

Files

Data/IOData.hs view
@@ -21,6 +21,11 @@ import           System.IO                     (Handle) import qualified System.IO +#if !MIN_VERSION_text(0, 11, 3)+import           Control.Exception             (handle, throwIO)+import           System.IO.Error               (isEOFError)+#endif+ -- | Data which can be read to and from files and handles. -- -- Note that, for lazy sequences, these operations may perform@@ -66,7 +71,13 @@     hGetChunk = liftIO . Text.hGetChunk #else     -- Dangerously inefficient!-    hGetChunk = liftIO . liftM Text.singleton . System.IO.hGetChar+    hGetChunk =+        liftIO . handleEOF . liftM Text.singleton . System.IO.hGetChar+      where+        handleEOF = handle $ \e ->+            if isEOFError e+                then Prelude.return Text.empty+                else throwIO e #endif instance IOData LText.Text where     readFile = liftIO . LText.readFile . FilePath.encodeString
chunked-data.cabal view
@@ -1,5 +1,5 @@ name:                chunked-data-version:             0.1.0.0+version:             0.1.0.1 synopsis:            Typeclasses for dealing with various chunked data representations description:         Originally present in classy-prelude. homepage:            https://github.com/fpco/chunked-data