Fix performance issue due to infinit result of splitEvery

parent 519719a9
...@@ -55,5 +55,3 @@ main = do ...@@ -55,5 +55,3 @@ main = do
putStrLn $ "Mean size of docs:" <> show (docsSize docs') putStrLn $ "Mean size of docs:" <> show (docsSize docs')
writeCsv wPath (h, docs') writeCsv wPath (h, docs')
...@@ -109,7 +109,7 @@ ma = movingAverage 3 ...@@ -109,7 +109,7 @@ ma = movingAverage 3
-- | splitEvery n == chunkAlong n n -- | splitEvery n == chunkAlong n n
splitEvery :: Int -> [a] -> [[a]] splitEvery :: Int -> [a] -> [[a]]
splitEvery _ [] = L.cycle [[]] splitEvery _ [] = []
splitEvery n xs = splitEvery n xs =
let (h,t) = L.splitAt n xs let (h,t) = L.splitAt n xs
in h : splitEvery n t in h : splitEvery n t
......
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