Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Incremental: don't delay returning some results

Fixes #28.
  • Loading branch information...
commit a4f3e281ecdb4c04f3e4621f976dd68750c84767 1 parent ae04feb
@tibbe authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 Data/Csv/Incremental.hs
View
10 Data/Csv/Incremental.hs
@@ -285,11 +285,13 @@ decodeWithP p !opts = go Incomplete [] . parser
go m acc (A.Done rest r)
| B.null rest = case m of
Complete -> Done (reverse acc')
- Incomplete -> Partial cont
+ Incomplete
+ | null acc' -> Partial (cont acc')
+ | otherwise -> Some (reverse acc') (cont [])
| otherwise = go m acc' (parser rest)
- where cont s
- | B.null s = Done (reverse acc')
- | otherwise = go Incomplete acc' (parser s)
+ where cont acc'' s
+ | B.null s = Done (reverse acc'')
+ | otherwise = go Incomplete acc'' (parser s)
acc' | blankLine r = acc
| otherwise = convert r : acc
Please sign in to comment.
Something went wrong with that request. Please try again.