Skip to content

Commit

Permalink
Merge pull request #11 from ak3n/master
Browse files Browse the repository at this point in the history
Fixed pattern matching for Fail constructor.
  • Loading branch information
litherum committed Nov 24, 2013
2 parents 2632d85 + 21be76a commit 4e72752
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Data/Conduit/Cereal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sinkGet :: C.MonadThrow m => Get r -> C.Consumer BS.ByteString m r
sinkGet = mkSinkGet errorHandler terminationHandler
where errorHandler msg = pipeError $ GetException msg
terminationHandler f = case f BS.empty of
Fail msg -> pipeError $ GetException msg
Fail msg _ -> pipeError $ GetException msg
Done r lo -> C.leftover lo >> return r
Partial _ -> pipeError $ GetException "Failed reading: Internal error: unexpected Partial."

Expand Down
4 changes: 2 additions & 2 deletions Data/Conduit/Cereal/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mkConduitGet errorHandler get = consume True (runGetPartial get) [] BS.empty
| BS.null s = C.await >>= maybe (when (not $ null b) (C.leftover $ BS.concat $ reverse b)) (pull f b)
| otherwise = consume False f b s
consume initial f b s = case f s of
Fail msg -> do
Fail msg _ -> do
when (not $ null b) (C.leftover $ BS.concat $ reverse consumed)
errorHandler msg
Partial p -> pull p consumed BS.empty
Expand All @@ -56,7 +56,7 @@ mkSinkGet errorHandler terminationHandler get = consume (runGetPartial get) [] B
Just a -> pull f b a
| otherwise = consume f b s
consume f b s = case f s of
Fail msg -> do
Fail msg _ -> do
when (not $ null b) (C.leftover $ BS.concat $ reverse consumed)
errorHandler msg
Partial p -> pull p consumed BS.empty
Expand Down

0 comments on commit 4e72752

Please sign in to comment.