mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-20 21:39:53 +01:00
update library version.
This commit is contained in:
parent
698c1c2b7a
commit
80fd8e70f0
@ -21,16 +21,16 @@ Extra-source-files:
|
||||
|
||||
Library
|
||||
Build-depends: base >=4 && <5,
|
||||
transformers >= 0.2.1 && < 0.2.2,
|
||||
transformers >= 0.2 && < 0.3,
|
||||
MonadCatchIO-transformers >= 0.2.2 && < 0.2.3,
|
||||
bytestring >= 0.9 && < 0.10,
|
||||
vector >= 0.6.0 && < 0.6.1,
|
||||
iteratee >= 0.4 && < 0.5,
|
||||
attoparsec >= 0.8.1 && < 0.8.2,
|
||||
vector >= 0.7 && < 0.8,
|
||||
iteratee >= 0.8 && < 0.9,
|
||||
attoparsec >= 0.8 && < 0.9,
|
||||
binary >= 0.5.0 && < 0.5.1,
|
||||
data-binary-ieee754 >= 0.4 && < 0.5,
|
||||
deepseq >= 1.1 && <1.2,
|
||||
template-haskell >= 2.4 && < 2.5
|
||||
template-haskell >= 2.5 && < 2.6
|
||||
|
||||
Ghc-options: -Wall
|
||||
Hs-source-dirs: src
|
||||
|
@ -37,18 +37,18 @@ getI = parserToIteratee get
|
||||
-- | Enumerator
|
||||
enumHandleNonBlocking :: MonadIO m => Int -> Handle -> I.Enumerator B.ByteString m a
|
||||
enumHandleNonBlocking bufSize h =
|
||||
I.enumFromCallback $ readSome bufSize h
|
||||
I.enumFromCallback (readSome bufSize h) ()
|
||||
|
||||
readSome :: MonadIO m => Int -> Handle -> m (Either SomeException (Bool, B.ByteString))
|
||||
readSome bufSize h = liftIO $ do
|
||||
readSome :: MonadIO m => Int -> Handle -> st -> m (Either SomeException ((Bool, st), B.ByteString))
|
||||
readSome bufSize h st = liftIO $ do
|
||||
ebs <- try $ hGetSome bufSize h
|
||||
case ebs of
|
||||
Left exc ->
|
||||
return $ Left (exc :: SomeException)
|
||||
Right bs | B.null bs ->
|
||||
return $ Right (False, B.empty)
|
||||
return $ Right ((False, st), B.empty)
|
||||
Right bs ->
|
||||
return $ Right (True, bs)
|
||||
return $ Right ((True, st), bs)
|
||||
|
||||
hGetSome :: Int -> Handle -> IO B.ByteString
|
||||
hGetSome bufSize h = do
|
||||
|
Loading…
x
Reference in New Issue
Block a user