1module Util.Zlib (decompressEither) where
3-- From http://stackoverflow.com/questions/10043102/how-to-catch-the-decompress-ioerror/10045963#10045963
4import Codec.Compression.Zlib.Internal
5import Data.ByteString.Lazy (ByteString, fromChunks)
6import Control.Arrow (right)
8decompressEither :: ByteString -> Either (DecompressError, String) ByteString
9decompressEither = finalise
10 . foldDecompressStream cons nil err
11 . decompressWithErrors zlibFormat defaultDecompressParams
12 where err errorCode errorString = Left (errorCode, errorString)
14 cons chunk = right (chunk :)
15 finalise = right fromChunks
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list