Fix the strictness of the foldl decoder (#140)

This commit is contained in:
Nikita Volkov 2021-09-17 10:56:29 +03:00
parent 7a53a06960
commit f3cc8542ca

View File

@ -164,7 +164,7 @@ foldl step init rowDec =
rowResult <- Row.run rowDec (result, intToRow rowIndex, maxCols, integerDatetimes)
case rowResult of
Left !x -> writeIORef failureRef (Just (RowError rowIndex x))
Right !x -> modifyIORef accRef (\acc -> step acc x)
Right !x -> modifyIORef' accRef (\acc -> step acc x)
readIORef failureRef >>= \case
Nothing -> Right <$> readIORef accRef
Just x -> pure (Left x)