Commit 1d27a444 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Fix infinite loop bug in chunksOfSize.

parent 47764c0e
......@@ -49,7 +49,7 @@ chunksOfSize size strings = reverse chunk : chunksOfSize size rest
(chunk, rest) = go [] 0 strings
go res _ [] = (res, [])
go res chunkSize (s:ss) =
if newSize > size then (chunk, s:ss) else go (s:res) newSize ss
if newSize > size then (res, s:ss) else go (s:res) newSize ss
where
newSize = chunkSize + length s
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment